]> git.ipfire.org Git - thirdparty/lxc.git/commit
uniformly nullify std fds
authorTycho Andersen <tycho.andersen@canonical.com>
Wed, 10 Jun 2015 21:57:50 +0000 (21:57 +0000)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 1 Jul 2015 17:46:25 +0000 (13:46 -0400)
commitd92577ffcede99e510758b1e2bcd7d06f02e8dd9
tree271f7627bef107a6342f6626203a7d759d0e1ae8
parent6d4a12a3acca6bc237bb454a291f9685fbe21031
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@canonical.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/bdev.c
src/lxc/lxccontainer.c
src/lxc/monitor.c
src/lxc/start.c
src/lxc/utils.c
src/lxc/utils.h