[lxc-devel] create_run_template() - question

Kevin Wilson wkevils at gmail.com
Sat Dec 14 10:04:24 UTC 2013


Hello,
Could anybody please explain:
In  create_run_template() ,
https://github.com/lxc/lxc/blob/master/src/lxc/lxccontainer.c

we have:

 if (quiet) {
                        close(0);
                        close(1);
                        close(2);
                        open("/dev/zero", O_RDONLY);
                        open("/dev/null", O_RDWR);
                        open("/dev/null", O_RDWR);
                }

Why do we need twice to call  open("/dev/null", O_RDWR) ? Is it have
to do with running as daemon ? or is it redundant ?
We don't use the returned fd in both cases.

Kevin


More information about the lxc-devel mailing list