]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/start.c
uniformly nullify std fds
authorTycho Andersen <tycho.andersen@canonical.com>
Wed, 10 Jun 2015 21:57:50 +0000 (21:57 +0000)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 11 Jun 2015 04:04:51 +0000 (23:04 -0500)
commit69aeabac1ad21cdc55f0f7866cf64559d7215ab2
tree988c5fa0be24f617484905de1cf4de8021417b02
parent5b72de5fd3196a084f2d7d640f3478aa29627b17
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