upgraded signal handling to 4.1bsd (mikey olson)
authorBill Joy <root@ucbvax.Berkeley.EDU>
Fri, 12 Feb 1982 03:30:09 +0000 (19:30 -0800)
committerBill Joy <root@ucbvax.Berkeley.EDU>
Fri, 12 Feb 1982 03:30:09 +0000 (19:30 -0800)
SCCS-vsn: usr.bin/lock/lock.c 4.2

usr/src/usr.bin/lock/lock.c

index 981da93..17719c2 100644 (file)
@@ -1,7 +1,7 @@
-static char *sccsid = "@(#)lock.c      4.1 (Berkeley) %G%";
+static char *sccsid = "@(#)lock.c      4.2 (Berkeley) %G%";
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <sys/types.h>
-#include <stat.h>
+#include <sys/stat.h>
 #include <signal.h>
 #include <sgtty.h>
 
 #include <signal.h>
 #include <sgtty.h>
 
@@ -18,9 +18,16 @@ main(argc, argv)
        register int t;
        struct stat statb;
 
        register int t;
        struct stat statb;
 
-       for (t = 1; t <= 16; t++)
-               if (t != SIGHUP)
-               signal(t, SIG_IGN);
+       
+       /*
+        *      Ignore signals generated from tty keyboard.  These signals
+        *      are for xBSD only.  This program should be compiled with
+        *      the jobs library (cc ... -ljobs).
+        */
+       sigset( SIGINT, SIG_IGN ); 
+       sigset( SIGQUIT, SIG_IGN ); 
+       sigset( SIGTSTP, SIG_IGN ); 
+
        if (argc > 0)
                argv[0] = 0;
        if (gtty(0, &tty))
        if (argc > 0)
                argv[0] = 0;
        if (gtty(0, &tty))