summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-21 13:16:50 +0000
committerStefan Metzmacher <metze@samba.org>2006-03-21 13:16:50 +0000
commitc59d3c793cb403b863740452f646209941f5f1ea (patch)
tree8ba267016811fe3d27b0115ca1b5c041353f25d6 /source/lib
parent818d0b169e307c83ea16de42a6ad6e6a42861b73 (diff)
downloadsamba-c59d3c793cb403b863740452f646209941f5f1ea.tar.gz
samba-c59d3c793cb403b863740452f646209941f5f1ea.tar.xz
samba-c59d3c793cb403b863740452f646209941f5f1ea.zip
r14618: add --no-process-group to all server programms
to make the following possible: timelimit 20000 bin/nmbd -F -S --no-process-group timelimit 20000 bin/smbd -F -S --no-process-group this is needed to 'make test' working without losing child processes metze
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 6e0a7c0e2f9..121beeecc04 100644
--- a/source/lib/util.c
+++ b/source/lib/util.c
@@ -823,7 +823,7 @@ void smb_msleep(unsigned int t)
Become a daemon, discarding the controlling terminal.
****************************************************************************/
-void become_daemon(BOOL Fork)
+void become_daemon(BOOL Fork, BOOL no_process_group)
{
if (Fork) {
if (sys_fork()) {
@@ -833,9 +833,9 @@ void become_daemon(BOOL Fork)
/* detach from the terminal */
#ifdef HAVE_SETSID
- setsid();
+ if (!no_process_group) setsid();
#elif defined(TIOCNOTTY)
- {
+ if (!no_process_group) {
int i = sys_open("/dev/tty", O_RDWR, 0);
if (i != -1) {
ioctl(i, (int) TIOCNOTTY, (char *)0);