c9468e0bfc
- add patch from FreeBSD port: Only flag the loopback address (127.0.0.1) on loopback interfaces with the noadvice bit. Other IP# numbers are valid and should be advertised.
43 lines
940 B
Plaintext
43 lines
940 B
Plaintext
--- src/task.c.orig Wed Feb 17 18:32:18 1999
|
|
+++ src/task.c Tue Apr 20 18:16:01 1999
|
|
@@ -5903,12 +5903,20 @@
|
|
}
|
|
|
|
/* Remove our association with a controling tty */
|
|
-#ifdef USE_SETPGRP
|
|
+#if defined(USE_SETPGRP) || defined(USE_SETSID)
|
|
+#if defined(USE_SETPGRP)
|
|
t = setpgrp();
|
|
if (t < 0) {
|
|
perror("task_daemonize: setpgrp");
|
|
exit(1);
|
|
}
|
|
+#else /* USE_SETPGRP */
|
|
+ t = setsid();
|
|
+ if (t < 0) {
|
|
+ perror("task_daemonize: setsid");
|
|
+ exit(1);
|
|
+ }
|
|
+#endif /* USE_SETPGRP */
|
|
|
|
task_signal_ignore(SIGHUP);
|
|
|
|
@@ -5927,7 +5935,7 @@
|
|
/* Parent */
|
|
exit(0);
|
|
}
|
|
-#else /* USE_SETPGRP */
|
|
+#else /* defined(USE_SETPGRP) || defined(USE_SETSID) */
|
|
t = setpgrp(0, getpid());
|
|
if (t < 0) {
|
|
perror("task_daemonize: setpgrp");
|
|
@@ -5942,7 +5950,7 @@
|
|
}
|
|
(void) close(t);
|
|
}
|
|
-#endif /* USE_SETPGRP */
|
|
+#endif /* defined(USE_SETPGRP) || defined(USE_SETSID) */
|
|
}
|
|
|
|
/* Close all open files */
|