save history if exceed cpu time or file size limits in shell
authorKirk McKusick <mckusic@ucbvax.Berkeley.EDU>
Sat, 13 Feb 1982 07:28:50 +0000 (23:28 -0800)
committerKirk McKusick <mckusic@ucbvax.Berkeley.EDU>
Sat, 13 Feb 1982 07:28:50 +0000 (23:28 -0800)
SCCS-vsn: bin/csh/csh.c 4.6

usr/src/bin/csh/csh.c

index cf78dec..fa371af 100644 (file)
@@ -1,4 +1,4 @@
-static char *sccsid = "@(#)csh.c 4.5 %G%";
+static char *sccsid = "@(#)csh.c 4.6 %G%";
 
 #include "sh.h"
 #include <sys/ioctl.h>
 
 #include "sh.h"
 #include <sys/ioctl.h>
@@ -114,8 +114,11 @@ main(c, av)
        sigset(SIGINT, parintr);                        /* ... restore */
        parterm = signal(SIGTERM, SIG_IGN);     /* parents terminability */
        signal(SIGTERM, parterm);                       /* ... restore */
        sigset(SIGINT, parintr);                        /* ... restore */
        parterm = signal(SIGTERM, SIG_IGN);     /* parents terminability */
        signal(SIGTERM, parterm);                       /* ... restore */
-       if (loginsh)
+       if (loginsh) {
                signal(SIGHUP, phup);           /* exit processing on HUP */
                signal(SIGHUP, phup);           /* exit processing on HUP */
+               signal(SIGXCPU, phup);          /* ...and on XCPU */
+               signal(SIGXFSZ, phup);          /* ...and on XFSZ */
+       }
 
        /*
         * Process the arguments.
 
        /*
         * Process the arguments.