new signals
authorSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 12 Jun 1983 16:41:18 +0000 (08:41 -0800)
committerSam Leffler <sam@ucbvax.Berkeley.EDU>
Sun, 12 Jun 1983 16:41:18 +0000 (08:41 -0800)
SCCS-vsn: libexec/comsat/comsat.c 4.7
SCCS-vsn: libexec/rexecd/rexecd.c 4.9
SCCS-vsn: libexec/rlogind/rlogind.c 4.16
SCCS-vsn: usr.sbin/edquota/edquota.c 4.5

usr/src/libexec/comsat/comsat.c
usr/src/libexec/rexecd/rexecd.c
usr/src/libexec/rlogind/rlogind.c
usr/src/usr.sbin/edquota/edquota.c

index 50c022b..fc2252d 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char *sccsid = "@(#)comsat.c    4.6 83/05/27";
+static char *sccsid = "@(#)comsat.c    4.7 83/06/12";
 #endif
 
 #include <sys/types.h>
 #endif
 
 #include <sys/types.h>
@@ -59,8 +59,8 @@ char **argv;
                wait(0);
        sleep(10);
        onalrm();
                wait(0);
        sleep(10);
        onalrm();
-       sigset(SIGALRM, onalrm);
-       sigignore(SIGTTOU);
+       signal(SIGALRM, onalrm);
+       signal(SIGTTOU, SIG_IGN);
        s = socket(AF_INET, SOCK_DGRAM, 0, 0);
        if (s < 0) {
                perror("socket");
        s = socket(AF_INET, SOCK_DGRAM, 0, 0);
        if (s < 0) {
                perror("socket");
@@ -194,7 +194,7 @@ jkfprintf(tp, name, offset)
 
                if (linecnt <= 0 || charcnt <= 0) {  
                        fprintf(tp,"...more...%s\n", cr);
 
                if (linecnt <= 0 || charcnt <= 0) {  
                        fprintf(tp,"...more...%s\n", cr);
-                       break;
+                       return;
                }
                cp = index(line, ':');
                if (cp &&
                }
                cp = index(line, ':');
                if (cp &&
index 2a8163a..2e067c0 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)rexecd.c   4.8 83/02/21";
+static char sccsid[] = "@(#)rexecd.c   4.9 83/06/12";
 #endif
 
 #include <sys/ioctl.h>
 #endif
 
 #include <sys/ioctl.h>
@@ -68,7 +68,7 @@ main(argc, argv)
                perror("rexecd: bind:");
                exit(1);
        }
                perror("rexecd: bind:");
                exit(1);
        }
-       sigset(SIGCHLD, reapchild);
+       signal(SIGCHLD, reapchild);
        listen(f, 10);
        for (;;) {
                int s, len = sizeof (from);
        listen(f, 10);
        for (;;) {
                int s, len = sizeof (from);
index b0303c9..072b8fa 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)rlogind.c  4.15 83/06/02";
+static char sccsid[] = "@(#)rlogind.c  4.16 83/06/12";
 #endif
 
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
@@ -87,7 +87,7 @@ main(argc, argv)
                perror("rlogind: bind");
                exit(1);
        }
                perror("rlogind: bind");
                exit(1);
        }
-       sigset(SIGCHLD, reapchild);
+       signal(SIGCHLD, reapchild);
        listen(f, 10);
        for (;;) {
                int s, len = sizeof (from);
        listen(f, 10);
        for (;;) {
                int s, len = sizeof (from);
@@ -198,7 +198,7 @@ gotpty:
                ioctl(p, FIONBIO, &on);
                ioctl(p, TIOCPKT, &on);
                signal(SIGTSTP, SIG_IGN);
                ioctl(p, FIONBIO, &on);
                ioctl(p, TIOCPKT, &on);
                signal(SIGTSTP, SIG_IGN);
-               sigset(SIGCHLD, cleanup);
+               signal(SIGCHLD, cleanup);
                for (;;) {
                        int ibits = 0, obits = 0;
 
                for (;;) {
                        int ibits = 0, obits = 0;
 
index 305d706..ea45aa9 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)edquota.c  4.4 (Berkeley, from Melbourne) %G%";
+static char sccsid[] = "@(#)edquota.c  4.5 (Berkeley, from Melbourne) %G%";
 #endif
 
 /*
 #endif
 
 /*
@@ -15,7 +15,6 @@ static char sccsid[] = "@(#)edquota.c 4.4 (Berkeley, from Melbourne) %G%";
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <sys/param.h>
 #include <sys/stat.h>
 #include <sys/file.h>
-#define QUOTA
 #include <sys/quota.h>
 
 #define        DEFEDITOR       "/usr/ucb/vi"
 #include <sys/quota.h>
 
 #define        DEFEDITOR       "/usr/ucb/vi"
@@ -102,12 +101,10 @@ getentry(name)
 editit()
 {
        register pid, xpid;
 editit()
 {
        register pid, xpid;
-       int stat;
-
-       sighold(SIGINT);
-       sighold(SIGQUIT);
-       sighold(SIGHUP);
+       int stat, omask;
 
 
+#define        mask(s) (1<<((s)-1))
+       omask = sigblock(mask(SIGINT)|mask(SIGQUIT)|mask(SIGHUP));
  top:
        if ((pid = fork()) < 0) {
                extern errno;
  top:
        if ((pid = fork()) < 0) {
                extern errno;
@@ -126,12 +123,9 @@ editit()
        if (pid == 0) {
                register char *ed;
 
        if (pid == 0) {
                register char *ed;
 
-               sigrelse(SIGINT);
-               sigrelse(SIGQUIT);
-               sigrelse(SIGHUP);
+               sigsetmask(omask);
                setgid(getgid());
                setuid(getuid());
                setgid(getgid());
                setuid(getuid());
-
                if ((ed = getenv("EDITOR")) == (char *)0)
                        ed = DEFEDITOR;
                execlp(ed, ed, tmpfil, 0);
                if ((ed = getenv("EDITOR")) == (char *)0)
                        ed = DEFEDITOR;
                execlp(ed, ed, tmpfil, 0);
@@ -141,9 +135,7 @@ editit()
        while ((xpid = wait(&stat)) >= 0)
                if (xpid == pid)
                        break;
        while ((xpid = wait(&stat)) >= 0)
                if (xpid == pid)
                        break;
-       sigrelse(SIGINT);
-       sigrelse(SIGQUIT);
-       sigrelse(SIGHUP);
+       sigsetmask(omask);
        return (!stat);
 }
 
        return (!stat);
 }