On Mon, 16.06.14 21:32, Geunsik Lim ([email protected]) wrote:

> Hi all,
> 
> Recently, i checked that there are  some of the "close_all_fds" functions
> as follows
> Why we Systemd run this functions? Whey this functions need Systemd's
> management?
> 
> invain@u1204lgs:/sandbox/tizentvfolder/systemd$ grep -R "close_all_fds" ./*
> ./src/nspawn.c:                close_all_fds(NULL, 0);
> ./src/util.c:int close_all_fds(const int except[], unsigned n_except) {
> ./src/util.c:        close_all_fds(NULL, 0);
> ./src/main.c:                close_all_fds(NULL, 0);
> ./src/spawn-agent.c:                close_all_fds(NULL, 0);
> ./src/execute.c:                err = close_all_fds(socket_fd >= 0 ?
> &socket_fd : fds,
> ./src/execute.c:                err = close_all_fds(fds, n_fds);
> ./src/util.h:int close_all_fds(const int except[], unsigned n_except);

David is right, this is really just a safety net, and particularly
useful when one of our tools is invoked from arbitrary code that might
not be written cleanly.

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to