SCCS-vsn: usr.bin/mail/cmd1.c 2.2.1.1
SCCS-vsn: usr.bin/mail/collect.c 2.7.1.2
SCCS-vsn: usr.bin/mail/fio.c 2.3.1.1
SCCS-vsn: usr.bin/mail/lex.c 2.5.1.1
SCCS-vsn: usr.bin/mail/popen.c 1.2.1.2
SCCS-vsn: usr.bin/mail/tty.c 2.1.1.1
-static char *SccsId = "@(#)cmd1.c 2.5 %G%";
+static char *SccsId = "@(#)cmd1.c 2.2.1.1 %G%";
/*
* Print the current active headings.
/*
* Print the current active headings.
+# else
+ signal(SIGPIPE, brokpipe);
+# endif
-static char *SccsId = "@(#)collect.c 2.7.1.1 %G%";
+static char *SccsId = "@(#)collect.c 2.7.1.2 %G%";
#include "rcv.h"
#include <sys/stat.h>
#include "rcv.h"
#include <sys/stat.h>
static int (*savesig)(); /* Previous SIGINT value */
static int (*savehup)(); /* Previous SIGHUP value */
static int (*savesig)(); /* Previous SIGINT value */
static int (*savehup)(); /* Previous SIGHUP value */
static int (*savecont)(); /* Previous SIGCONT value */
static int (*savecont)(); /* Previous SIGCONT value */
static FILE *newi; /* File for saving away */
static FILE *newo; /* Output side of same */
static int hf; /* Ignore interrups */
static FILE *newi; /* File for saving away */
static FILE *newo; /* Output side of same */
static int hf; /* Ignore interrups */
char linebuf[LINESIZE], *cp;
extern char tempMail[];
int notify();
char linebuf[LINESIZE], *cp;
extern char tempMail[];
int notify();
+ extern collintsig(), collhupsig();
noreset++;
ibuf = obuf = NULL;
noreset++;
ibuf = obuf = NULL;
else
hf = 0;
hadintr = 0;
else
hf = 0;
hadintr = 0;
if ((savesig = sigset(SIGINT, SIG_IGN)) != SIG_IGN)
sigset(SIGINT, hf ? intack : collrub), sighold(SIGINT);
if ((savehup = sigset(SIGHUP, SIG_IGN)) != SIG_IGN)
if ((savesig = sigset(SIGINT, SIG_IGN)) != SIG_IGN)
sigset(SIGINT, hf ? intack : collrub), sighold(SIGINT);
if ((savehup = sigset(SIGHUP, SIG_IGN)) != SIG_IGN)
- sigset(SIGHUP, collrub), sighold(SIGINT);
+ sigset(SIGHUP, collrub), sighold(SIGHUP);
savecont = sigset(SIGCONT, collcont);
savecont = sigset(SIGCONT, collcont);
+# else VMUNIX
+ savesig = signal(SIGINT, SIG_IGN);
+ savehup = signal(SIGHUP, SIG_IGN);
+# endif VMUNIX
newi = NULL;
newo = NULL;
if ((obuf = fopen(tempMail, "w")) == NULL) {
newi = NULL;
newo = NULL;
if ((obuf = fopen(tempMail, "w")) == NULL) {
eof = 0;
for (;;) {
setjmp(coljmp);
eof = 0;
for (;;) {
setjmp(coljmp);
sigrelse(SIGINT);
sigrelse(SIGHUP);
sigrelse(SIGINT);
sigrelse(SIGHUP);
+# else VMUNIX
+ if (savesig != SIG_IGN)
+ signal(SIGINT, hf ? intack : collintsig);
+ if (savehup != SIG_IGN)
+ signal(SIGHUP, collhupsig);
+# endif VMUNIX
flush();
if (readline(stdin, linebuf) <= 0) {
if (intty && value("ignoreeof") != NOSTR) {
flush();
if (readline(stdin, linebuf) <= 0) {
if (intty && value("ignoreeof") != NOSTR) {
/*
* Simulate end of file on input.
*/
/*
* Simulate end of file on input.
*/
fclose(obuf);
rewind(ibuf);
sigset(SIGINT, savesig);
sigset(SIGHUP, savehup);
fclose(obuf);
rewind(ibuf);
sigset(SIGINT, savesig);
sigset(SIGHUP, savehup);
sigset(SIGCONT, savecont);
sigset(SIGCONT, savecont);
noreset = 0;
return(ibuf);
noreset = 0;
return(ibuf);
fclose(obuf);
sigset(SIGINT, savesig);
sigset(SIGHUP, savehup);
fclose(obuf);
sigset(SIGINT, savesig);
sigset(SIGHUP, savehup);
sigset(SIGCONT, savecont);
sigset(SIGCONT, savecont);
noreset = 0;
return(NULL);
}
noreset = 0;
return(NULL);
}
register char *edit;
sig = sigset(SIGINT, SIG_IGN);
register char *edit;
sig = sigset(SIGINT, SIG_IGN);
scont = sigset(SIGCONT, foonly);
scont = sigset(SIGCONT, foonly);
if (stat(tempEdit, &sbuf) >= 0) {
printf("%s: file exists\n", tempEdit);
goto out;
if (stat(tempEdit, &sbuf) >= 0) {
printf("%s: file exists\n", tempEdit);
goto out;
fix:
perror(tempEdit);
out:
fix:
perror(tempEdit);
out:
sigset(SIGINT, sig);
newi = ibuf;
return(obuf);
sigset(SIGINT, sig);
newi = ibuf;
return(obuf);
* were previously set anyway.
*/
* were previously set anyway.
*/
+# ifndef VMUNIX
+collintsig()
+{
+ signal(SIGINT, SIG_IGN);
+ collrub(SIGINT);
+}
+
+collhupsig()
+{
+ signal(SIGHUP, SIG_IGN);
+ collrub(SIGHUP);
+}
+# endif VMUNIX
+
collrub(s)
{
register FILE *dbuf;
collrub(s)
{
register FILE *dbuf;
hadintr++;
clrbuf(stdout);
printf("\n(Interrupt -- one more to kill letter)\n");
hadintr++;
clrbuf(stdout);
printf("\n(Interrupt -- one more to kill letter)\n");
longjmp(coljmp, 1);
}
fclose(newo);
longjmp(coljmp, 1);
}
fclose(newo);
fclose(newi);
sigset(SIGINT, savesig);
sigset(SIGHUP, savehup);
fclose(newi);
sigset(SIGINT, savesig);
sigset(SIGHUP, savehup);
sigset(SIGCONT, savecont);
sigset(SIGCONT, savecont);
if (rcvmode) {
if (s == SIGHUP)
hangup(SIGHUP);
if (rcvmode) {
if (s == SIGHUP)
hangup(SIGHUP);
-static char *SccsId = "@(#)fio.c 2.7 %G%";
+static char *SccsId = "@(#)fio.c 2.3.1.1 %G%";
/*
* Set up the input pointers while copying the mail file into
/*
* Set up the input pointers while copying the mail file into
+# ifndef VMUNIX
+static int SaveSigs[32];
+# endif VMUNIX
+
/*
* Hold signals SIGHUP - SIGQUIT.
*/
/*
* Hold signals SIGHUP - SIGQUIT.
*/
register int i;
for (i = SIGHUP; i <= SIGQUIT; i++)
register int i;
for (i = SIGHUP; i <= SIGQUIT; i++)
+# else
+ SaveSigs[i] = signal(i, SIG_IGN);
+# endif
register int i;
for (i = SIGHUP; i <= SIGQUIT; i++)
register int i;
for (i = SIGHUP; i <= SIGQUIT; i++)
+# else
+ signal(i, SaveSigs[i]);
+# endif
* Lexical processing of commands.
*/
* Lexical processing of commands.
*/
-static char *SccsId = "@(#)lex.c 2.7 %G%";
+static char *SccsId = "@(#)lex.c 2.5.1.1 %G%";
char linebuf[LINESIZE];
int hangup(), contin();
char linebuf[LINESIZE];
int hangup(), contin();
sigset(SIGCONT, SIG_DFL);
sigset(SIGCONT, SIG_DFL);
if (rcvmode && !sourcing) {
if (sigset(SIGINT, SIG_IGN) != SIG_IGN)
sigset(SIGINT, stop);
if (rcvmode && !sourcing) {
if (sigset(SIGINT, SIG_IGN) != SIG_IGN)
sigset(SIGINT, stop);
top:
if (shudprompt) {
sigset(SIGCONT, contin);
top:
if (shudprompt) {
sigset(SIGCONT, contin);
printf(prompt);
}
flush();
printf(prompt);
}
flush();
break;
linebuf[n++] = ' ';
}
break;
linebuf[n++] = ' ';
}
sigset(SIGCONT, SIG_DFL);
sigset(SIGCONT, SIG_DFL);
if (execute(linebuf, 0))
return;
more: ;
if (execute(linebuf, 0))
return;
more: ;
+# ifndef VMUNIX
+ s = SIGINT;
+# endif VMUNIX
noreset = 0;
if (!inithdr)
sawcom++;
noreset = 0;
if (!inithdr)
sawcom++;
}
clrbuf(stdout);
printf("Interrupt\n");
}
clrbuf(stdout);
printf("Interrupt\n");
+# else
+ signal(s, stop);
+# endif
#include <stdio.h>
#include <signal.h>
#include <stdio.h>
#include <signal.h>
#define tst(a,b) (*mode == 'r'? (b) : (a))
#define RDR 0
#define WTR 1
static int popen_pid[20];
#define tst(a,b) (*mode == 'r'? (b) : (a))
#define RDR 0
#define WTR 1
static int popen_pid[20];
-static char *sccsid = "@(#)popen.c 1.2.1.1 %G%";
+static char *sccsid = "@(#)popen.c 1.2.1.2 %G%";
+
+# ifndef VMUNIX
+# define vfork fork
+# endif VMUNIX
{
register f, r;
int status;
{
register f, r;
int status;
f = fileno(ptr);
fclose(ptr);
f = fileno(ptr);
fclose(ptr);
sighold(SIGINT);
sighold(SIGQUIT);
sighold(SIGHUP);
sighold(SIGINT);
sighold(SIGQUIT);
sighold(SIGHUP);
- while((r = wait(&status)) != popen_pid[f] && r != -1)
+# endif VMUNIX
+ while((r = wait(&status)) != popen_pid[f] && r != -1 && errno != EINTR)
;
if(r == -1)
status = -1;
;
if(r == -1)
status = -1;
sigrelse(SIGINT);
sigrelse(SIGQUIT);
sigrelse(SIGHUP);
sigrelse(SIGINT);
sigrelse(SIGQUIT);
sigrelse(SIGHUP);
-static char *SccsId = "@(#)tty.c 2.2 %G%";
+static char *SccsId = "@(#)tty.c 2.1.1.1 %G%";
static int c_erase; /* Current erase char */
static int c_kill; /* Current kill char */
static int c_erase; /* Current erase char */
static int c_kill; /* Current kill char */
register int s;
int errs;
register int s;
int errs;
savecont = sigset(SIGCONT, signull);
savecont = sigset(SIGCONT, signull);
errs = 0;
#ifndef TIOCSTI
ttyset = 0;
errs = 0;
#ifndef TIOCSTI
ttyset = 0;
if (hp->h_bcc != NOSTR)
hp->h_seq++;
}
if (hp->h_bcc != NOSTR)
hp->h_seq++;
}
sigset(SIGCONT, savecont);
sigset(SIGCONT, savecont);
#ifndef TIOCSTI
ttybuf.sg_erase = c_erase;
ttybuf.sg_kill = c_kill;
#ifndef TIOCSTI
ttybuf.sg_erase = c_erase;
ttybuf.sg_kill = c_kill;
cp2 = cp;
if (setjmp(rewrite))
goto redo;
cp2 = cp;
if (setjmp(rewrite))
goto redo;
sigset(SIGCONT, ttycont);
sigset(SIGCONT, ttycont);
while (cp2 < canonb + BUFSIZ) {
c = getc(stdin);
if (c == EOF || c == '\n')
while (cp2 < canonb + BUFSIZ) {
c = getc(stdin);
if (c == EOF || c == '\n')
sigset(SIGCONT, signull);
sigset(SIGCONT, signull);
if (c == EOF && ferror(stdin) && hadcont) {
redo:
hadcont = 0;
if (c == EOF && ferror(stdin) && hadcont) {
redo:
hadcont = 0;
return(readtty(pr, cp));
}
#ifndef TIOCSTI
return(readtty(pr, cp));
}
#ifndef TIOCSTI
- if (cp2 == NOSTR || *cp2 == '\0')
+ if (cp == NOSTR || *cp == '\0')
if (!ttyset)
return(strlen(canonb) > 0 ? savestr(canonb) : NOSTR);
while (*cp != '\0') {
if (!ttyset)
return(strlen(canonb) > 0 ? savestr(canonb) : NOSTR);
while (*cp != '\0') {
return(savestr(canonb));
}
return(savestr(canonb));
}
/*
* Receipt continuation.
*/
/*
* Receipt continuation.
*/
sigrelse(SIGCONT);
longjmp(rewrite, 1);
}
sigrelse(SIGCONT);
longjmp(rewrite, 1);
}
/*
* Null routine to satisfy
/*
* Null routine to satisfy