It takes _talent_ to implement a version of nohup that does everything except
authorRob Landley <rob@landley.net>
Tue, 23 May 2006 00:28:06 +0000 (00:28 -0000)
committerRob Landley <rob@landley.net>
Tue, 23 May 2006 00:28:06 +0000 (00:28 -0000)
the actual blocking of HUP.

coreutils/nohup.c

index ea1c4c55a0a11f738f2c8af8483b13edd6cfc36c..50f54cca6090f0e5004a24422149ec734294fe9a 100644 (file)
@@ -10,6 +10,7 @@
  */
 
 #include <fcntl.h>
+#include <signal.h>
 #include <unistd.h>
 #include "busybox.h"
 
@@ -44,8 +45,8 @@ int nohup_main(int argc, char *argv[])
        temp = isatty(2);
        if (temp) fdprintf(2,"Writing to %s\n", home ? home : nohupout);
        dup2(temp ? 1 : nullfd, 2);
-
        close(nullfd);
+       signal (SIGHUP, SIG_IGN);
 
        // Exec our new program.