Changeset 10308 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Jul 7, 2008 11:24:50 AM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 32929
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDaemonize.cpp
r8155 r10308 131 131 * Fork the child process and quit the parent. 132 132 * 133 * On Linux we'll fork once more at the end of it all just to be sure that 134 * we're not leaving any zombies behind. The SIGHUP stuff is ignored because 135 * the parent may throw us one before we get to the setsid stuff one some 136 * systems (BSD). 133 * This means: 134 * - fork once and become session leader (using setsid(2)) in 135 * order to detach from the controlling tty and make ourselves safe 136 * from Ctrl-C. The fork is required because the call to setsid will 137 * fail if we were already session leader. 138 * - On Linux, fork again in order to become a non-leader member of the 139 * session, as the leader will attach to any tty it opens, accidentally 140 * or otherwise (Sys V sematics). 141 * - The SIGHUP stuff is ignored because the parent may throw us one 142 * before we get to the setsid stuff one some systems (BSD). 137 143 */ 138 144 struct sigaction OldSigAct; … … 191 197 # ifdef RT_OS_LINUX 192 198 /* 193 * And fork again to avoid zomibies and stuff (non-standard daemon() behaviour). 199 * And fork again to lose session leader status (non-standard daemon() 200 * behaviour). 194 201 */ 195 202 pid = fork();
Note:
See TracChangeset
for help on using the changeset viewer.