(main) [!defined _POSIX_SOURCE]:
authorJim Meyering <jim@meyering.net>
Tue, 20 Apr 2004 10:44:42 +0000 (10:44 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 20 Apr 2004 10:44:42 +0000 (10:44 +0000)
Use simpler "signal (sig, SIG_IGN)" rather than sigaction equivalent.

src/nohup.c

index f476d84..c2b83c9 100644 (file)
@@ -158,18 +158,7 @@ main (int argc, char **argv)
        error (NOHUP_FAILURE, errno, _("failed to redirect standard error"));
     }
 
-  /* Ignore hang-up signals.  */
-  {
-#ifdef _POSIX_SOURCE
-    struct sigaction sigact;
-    sigact.sa_handler = SIG_IGN;
-    sigemptyset (&sigact.sa_mask);
-    sigact.sa_flags = 0;
-    sigaction (SIGHUP, &sigact, NULL);
-#else
-    signal (SIGHUP, SIG_IGN);
-#endif
-  }
+  signal (SIGHUP, SIG_IGN);
 
   {
     int exit_status;