[lxc-devel] [lxc/lxc] 3158ab: c/r: use fclose instead of close

GitHub noreply at github.com
Thu Jun 11 04:06:30 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 3158ab5b9e16bb26267378bd54e113495631f8f2
      https://github.com/lxc/lxc/commit/3158ab5b9e16bb26267378bd54e113495631f8f2
  Author: Tycho Andersen <tycho.andersen at canonical.com>
  Date:   2015-06-10 (Wed, 10 Jun 2015)

  Changed paths:
    M src/lxc/criu.c

  Log Message:
  -----------
  c/r: use fclose instead of close

We're leaking the FILE* here while closing the underlying fd; let's just
close the file and thus close both.

Reported-by: Coverity
Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


  Commit: bd9e78f5700066798ec8cc88151f4d8b8940fa83
      https://github.com/lxc/lxc/commit/bd9e78f5700066798ec8cc88151f4d8b8940fa83
  Author: Tycho Andersen <tycho.andersen at canonical.com>
  Date:   2015-06-10 (Wed, 10 Jun 2015)

  Changed paths:
    M src/lxc/criu.c

  Log Message:
  -----------
  c/r: remove unused variable mnts

Reported-by: Coverity
Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


  Commit: 5b72de5fd3196a084f2d7d640f3478aa29627b17
      https://github.com/lxc/lxc/commit/5b72de5fd3196a084f2d7d640f3478aa29627b17
  Author: Tycho Andersen <tycho.andersen at canonical.com>
  Date:   2015-06-10 (Wed, 10 Jun 2015)

  Changed paths:
    M src/lxc/utils.h

  Log Message:
  -----------
  move utils.h #endif to end of file

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


  Commit: 69aeabac1ad21cdc55f0f7866cf64559d7215ab2
      https://github.com/lxc/lxc/commit/69aeabac1ad21cdc55f0f7866cf64559d7215ab2
  Author: Tycho Andersen <tycho.andersen at canonical.com>
  Date:   2015-06-10 (Wed, 10 Jun 2015)

  Changed paths:
    M src/lxc/bdev.c
    M src/lxc/lxccontainer.c
    M src/lxc/monitor.c
    M src/lxc/start.c
    M src/lxc/utils.c
    M src/lxc/utils.h

  Log Message:
  -----------
  uniformly nullify std fds

In various places throughout the code, we want to "nullify" the std fds,
opening them to /dev/null or zero or so. Instead, let's unify this code and do
it in such a way that Coverity (probably) won't complain.

v2: use /dev/null for stdin as well
v3: add a comment about use of C's short circuiting
v4: axe comment, check errors on dup2, s/quiet/need_null_stdfds

Reported-by: Coverity
Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>


Compare: https://github.com/lxc/lxc/compare/2a5da243873c...69aeabac1ad2


More information about the lxc-devel mailing list