X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/19f7cf64a65e157c4d0b5a846c95f65fdc588a35..03c98b7d1c0bf92013bc70d7f59f08eb803f2f65:/usr/src/usr.bin/mail/edit.c diff --git a/usr/src/usr.bin/mail/edit.c b/usr/src/usr.bin/mail/edit.c index c88b64209d..1971329daa 100644 --- a/usr/src/usr.bin/mail/edit.c +++ b/usr/src/usr.bin/mail/edit.c @@ -10,7 +10,7 @@ * Perform message editing functions. */ -static char *SccsId = "@(#)edit.c 1.2 %G%"; +static char *SccsId = "@(#)edit.c 2.4 %G%"; /* * Edit a message list. @@ -53,7 +53,7 @@ edit1(msgvec, ed) register char *cp, *cp2; register int c; int *ip, pid, mesg, lines; - unsigned int ms; + long ms; int (*sigint)(), (*sigquit)(); FILE *ibuf, *obuf; char edname[15], nbuf[10]; @@ -67,8 +67,8 @@ edit1(msgvec, ed) * Set signals; locate editor. */ - sigint = signal(SIGINT, SIG_IGN); - sigquit = signal(SIGQUIT, SIG_IGN); + sigint = sigset(SIGINT, SIG_IGN); + sigquit = sigset(SIGQUIT, SIG_IGN); /* * Deal with each message to be edited . . . @@ -108,7 +108,7 @@ edit1(msgvec, ed) perror(edname); goto out; } - if (send(mp, obuf) < 0) { + if (send(mp, obuf, 0) < 0) { perror(edname); fclose(obuf); remove(edname); @@ -144,10 +144,11 @@ edit1(msgvec, ed) goto out; } if (pid == 0) { + sigchild(); if (sigint != SIG_IGN) - signal(SIGINT, SIG_DFL); + sigsys(SIGINT, SIG_DFL); if (sigquit != SIG_IGN) - signal(SIGQUIT, SIG_DFL); + sigsys(SIGQUIT, SIG_DFL); execl(ed, ed, edname, 0); perror(ed); _exit(1); @@ -188,7 +189,7 @@ edit1(msgvec, ed) size = fsize(otf); mp->m_block = blockof(size); mp->m_offset = offsetof(size); - ms = 0; + ms = 0L; lines = 0; while ((c = getc(ibuf)) != EOF) { if (c == '\n') @@ -210,6 +211,6 @@ edit1(msgvec, ed) */ out: - signal(SIGINT, sigint); - signal(SIGQUIT, sigquit); + sigset(SIGINT, sigint); + sigset(SIGQUIT, sigquit); }