Delint (partially).

This commit is contained in:
mycroft 1998-07-28 02:47:19 +00:00
parent 2e7f98d7b4
commit 5924694d3a
13 changed files with 121 additions and 137 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: csh.c,v 1.21 1998/07/28 02:23:37 mycroft Exp $ */ /* $NetBSD: csh.c,v 1.22 1998/07/28 02:47:19 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1991, 1993\n\
#if 0 #if 0
static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93"; static char sccsid[] = "@(#)csh.c 8.2 (Berkeley) 10/12/93";
#else #else
__RCSID("$NetBSD: csh.c,v 1.21 1998/07/28 02:23:37 mycroft Exp $"); __RCSID("$NetBSD: csh.c,v 1.22 1998/07/28 02:47:19 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -71,9 +71,6 @@ __RCSID("$NetBSD: csh.c,v 1.21 1998/07/28 02:23:37 mycroft Exp $");
#include "extern.h" #include "extern.h"
#include "pathnames.h" #include "pathnames.h"
extern bool MapsAreInited;
extern bool NLSMapsAreInited;
/* /*
* C Shell * C Shell
* *
@ -100,7 +97,6 @@ bool batch = 0;
bool mflag = 0; bool mflag = 0;
bool prompt = 1; bool prompt = 1;
bool enterhist = 0; bool enterhist = 0;
bool tellwhat = 0;
extern char **environ; extern char **environ;
@ -473,8 +469,8 @@ main(argc, argv)
(void) signal(SIGQUIT, SIG_IGN); (void) signal(SIGQUIT, SIG_IGN);
(void) signal(SIGINT, pintr); (void) signal(SIGINT, pintr);
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
(void) signal(SIGTERM, SIG_IGN); (void) signal(SIGTERM, SIG_IGN);
if (quitit == 0 && arginp == 0) { if (quitit == 0 && arginp == 0) {
(void) signal(SIGTSTP, SIG_IGN); (void) signal(SIGTSTP, SIG_IGN);
@ -545,8 +541,8 @@ notty:
sigset_t osigset; sigset_t osigset;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
setintr = 0; setintr = 0;
parintr = SIG_IGN; /* Disable onintr */ parintr = SIG_IGN; /* Disable onintr */
@ -559,7 +555,7 @@ notty:
if (loginsh) if (loginsh)
(void) srcfile(_PATH_DOTLOGIN, 0, 0); (void) srcfile(_PATH_DOTLOGIN, 0, 0);
#endif #endif
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
setintr = osetintr; setintr = osetintr;
parintr = oparintr; parintr = oparintr;
} }
@ -747,11 +743,11 @@ srcunit(unit, onlyown, hflg)
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
} }
/* Setup the new values of the state stuff saved above */ /* Setup the new values of the state stuff saved above */
memcpy(&saveB, &B, sizeof(B)); (void) memcpy(&saveB, &B, sizeof(B));
fbuf = NULL; fbuf = NULL;
fseekp = feobp = fblocks = 0; fseekp = feobp = fblocks = 0;
oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0; oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0;
@ -767,14 +763,14 @@ srcunit(unit, onlyown, hflg)
* interrupted. * interrupted.
*/ */
if (setintr) if (setintr)
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
settell(); settell();
if ((my_reenter = setexit()) == 0) if ((my_reenter = setexit()) == 0)
process(0); /* 0 -> blow away on errors */ process(0); /* 0 -> blow away on errors */
if (setintr) if (setintr)
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
if (oSHIN >= 0) { if (oSHIN >= 0) {
int i; int i;
@ -785,7 +781,7 @@ srcunit(unit, onlyown, hflg)
xfree((ptr_t) fbuf); xfree((ptr_t) fbuf);
/* Reset input arena */ /* Reset input arena */
memcpy(&B, &saveB, sizeof(B)); (void) memcpy(&B, &saveB, sizeof(B));
(void) close(SHIN), SHIN = oSHIN; (void) close(SHIN), SHIN = oSHIN;
arginp = oarginp, onelflg = oonelflg; arginp = oarginp, onelflg = oonelflg;
@ -960,11 +956,11 @@ pintr1(wantnl)
sigset_t sigset, osigset; sigset_t sigset, osigset;
sigemptyset(&sigset); sigemptyset(&sigset);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
if (setintr) { if (setintr) {
sigset = osigset; sigset = osigset;
sigdelset(&sigset, SIGINT); (void) sigdelset(&sigset, SIGINT);
sigprocmask(SIG_SETMASK, &sigset, NULL); (void) sigprocmask(SIG_SETMASK, &sigset, NULL);
if (pjobs) { if (pjobs) {
pjobs = 0; pjobs = 0;
(void) fprintf(cshout, "\n"); (void) fprintf(cshout, "\n");
@ -973,8 +969,8 @@ pintr1(wantnl)
/* NOTREACHED */ /* NOTREACHED */
} }
} }
sigdelset(&osigset, SIGCHLD); (void) sigdelset(&osigset, SIGCHLD);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
(void) fpurge(cshout); (void) fpurge(cshout);
(void) endpwent(); (void) endpwent();
@ -1037,8 +1033,8 @@ process(catch)
*/ */
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
} }
/* /*
@ -1103,7 +1099,7 @@ process(catch)
* The parser may lose space if interrupted. * The parser may lose space if interrupted.
*/ */
if (setintr) if (setintr)
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
/* /*
* Save input text on the history list if reading in old history, or it * Save input text on the history list if reading in old history, or it

View File

@ -1,4 +1,4 @@
/* $NetBSD: csh.h,v 1.10 1997/07/04 21:23:54 christos Exp $ */ /* $NetBSD: csh.h,v 1.11 1998/07/28 02:47:19 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -188,8 +188,8 @@ jmp_buf reslab;
#define setexit() (setjmp(reslab)) #define setexit() (setjmp(reslab))
#define reset() longjmp(reslab, 1) #define reset() longjmp(reslab, 1)
/* Should use structure assignment here */ /* Should use structure assignment here */
#define getexit(a) memcpy((a), reslab, sizeof reslab) #define getexit(a) (void) memcpy((a), reslab, sizeof reslab)
#define resexit(a) memcpy(reslab, (a), sizeof reslab) #define resexit(a) (void) memcpy(reslab, (a), sizeof reslab)
Char *gointr; /* Label for an onintr transfer */ Char *gointr; /* Label for an onintr transfer */

View File

@ -1,4 +1,4 @@
/* $NetBSD: err.c,v 1.11 1998/07/28 02:23:38 mycroft Exp $ */ /* $NetBSD: err.c,v 1.12 1998/07/28 02:47:19 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: err.c,v 1.11 1998/07/28 02:23:38 mycroft Exp $"); __RCSID("$NetBSD: err.c,v 1.12 1998/07/28 02:47:19 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -312,7 +312,7 @@ seterror(id, va_alist)
#endif #endif
if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0])) if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
id = ERR_INVALID; id = ERR_INVALID;
vsnprintf(berr, sizeof(berr), errorlist[id], va); (void) vsnprintf(berr, sizeof(berr), errorlist[id], va);
va_end(va); va_end(va);
seterr = strsave(berr); seterr = strsave(berr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.c,v 1.13 1998/07/28 02:23:38 mycroft Exp $ */ /* $NetBSD: exec.c,v 1.14 1998/07/28 02:47:19 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)exec.c 8.3 (Berkeley) 5/23/95"; static char sccsid[] = "@(#)exec.c 8.3 (Berkeley) 5/23/95";
#else #else
__RCSID("$NetBSD: exec.c,v 1.13 1998/07/28 02:23:38 mycroft Exp $"); __RCSID("$NetBSD: exec.c,v 1.14 1998/07/28 02:47:19 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -202,7 +202,7 @@ doexec(v, t)
* this shell can still do subprocesses. * this shell can still do subprocesses.
*/ */
sigemptyset(&sigset); sigemptyset(&sigset);
sigprocmask(SIG_SETMASK, &sigset, NULL); (void) sigprocmask(SIG_SETMASK, &sigset, NULL);
/* /*
* If no path, no words in path, or a / in the filename then restrict the * If no path, no words in path, or a / in the filename then restrict the
* command search. * command search.

View File

@ -1,4 +1,4 @@
/* $NetBSD: extern.h,v 1.11 1998/07/28 02:23:38 mycroft Exp $ */ /* $NetBSD: extern.h,v 1.12 1998/07/28 02:47:20 mycroft Exp $ */
/*- /*-
* Copyright (c) 1991, 1993 * Copyright (c) 1991, 1993
@ -214,7 +214,6 @@ void lshift __P((Char **, int));
int number __P((Char *)); int number __P((Char *));
int prefix __P((Char *, Char *)); int prefix __P((Char *, Char *));
Char **saveblk __P((Char **)); Char **saveblk __P((Char **));
void setzero __P((char *, int));
Char *strip __P((Char *)); Char *strip __P((Char *));
Char *quote __P((Char *)); Char *quote __P((Char *));
char *strsave __P((char *)); char *strsave __P((char *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: file.c,v 1.13 1997/07/04 21:24:00 christos Exp $ */ /* $NetBSD: file.c,v 1.14 1998/07/28 02:47:20 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)file.c 8.2 (Berkeley) 3/19/94"; static char sccsid[] = "@(#)file.c 8.2 (Berkeley) 3/19/94";
#else #else
__RCSID("$NetBSD: file.c,v 1.13 1997/07/04 21:24:00 christos Exp $"); __RCSID("$NetBSD: file.c,v 1.14 1998/07/28 02:47:20 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -148,8 +148,8 @@ back_to_col_1()
sigset_t sigset, osigset; sigset_t sigset, osigset;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
(void) tcgetattr(SHOUT, &tty); (void) tcgetattr(SHOUT, &tty);
tty_normal = tty; tty_normal = tty;
tty.c_iflag &= ~INLCR; tty.c_iflag &= ~INLCR;
@ -157,7 +157,7 @@ back_to_col_1()
(void) tcsetattr(SHOUT, TCSADRAIN, &tty); (void) tcsetattr(SHOUT, TCSADRAIN, &tty);
(void) write(SHOUT, "\r", 1); (void) write(SHOUT, "\r", 1);
(void) tcsetattr(SHOUT, TCSADRAIN, &tty_normal); (void) tcsetattr(SHOUT, TCSADRAIN, &tty_normal);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
} }
/* /*
@ -173,8 +173,8 @@ pushback(string)
char c; char c;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
(void) tcgetattr(SHOUT, &tty); (void) tcgetattr(SHOUT, &tty);
tty_normal = tty; tty_normal = tty;
tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL); tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL);
@ -183,7 +183,7 @@ pushback(string)
for (p = string; (c = *p) != '\0'; p++) for (p = string; (c = *p) != '\0'; p++)
(void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c); (void) ioctl(SHOUT, TIOCSTI, (ioctl_t) & c);
(void) tcsetattr(SHOUT, TCSADRAIN, &tty_normal); (void) tcsetattr(SHOUT, TCSADRAIN, &tty_normal);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
} }
/* /*
@ -430,11 +430,11 @@ free_items(items)
sigset_t sigset, osigset;\ sigset_t sigset, osigset;\
\ \
sigemptyset(&sigset);\ sigemptyset(&sigset);\
sigaddset(&sigset, SIGINT);\ (void) sigaddset(&sigset, SIGINT);\
sigprocmask(SIG_BLOCK, &sigset, &osigset);\ (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);\
free_items(items);\ free_items(items);\
items = NULL;\ items = NULL;\
sigprocmask(SIG_SETMASK, &osigset, NULL);\ (void) sigprocmask(SIG_SETMASK, &osigset, NULL);\
} }
/* /*

View File

@ -1,4 +1,4 @@
/* $NetBSD: func.c,v 1.14 1998/07/28 02:23:38 mycroft Exp $ */ /* $NetBSD: func.c,v 1.15 1998/07/28 02:47:20 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)func.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: func.c,v 1.14 1998/07/28 02:23:38 mycroft Exp $"); __RCSID("$NetBSD: func.c,v 1.15 1998/07/28 02:47:20 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -157,8 +157,8 @@ doonintr(v, t)
if (vv == 0) { if (vv == 0) {
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
} else } else
(void) signal(SIGINT, SIG_DFL); (void) signal(SIGINT, SIG_DFL);
gointr = 0; gointr = 0;
@ -220,7 +220,7 @@ doalias(v, t)
vp = adrof1(strip(p), &aliases); vp = adrof1(strip(p), &aliases);
if (vp) { if (vp) {
blkpr(cshout, vp->vec); blkpr(cshout, vp->vec);
fputc('\n', cshout); (void) fputc('\n', cshout);
} }
} }
else { else {
@ -549,13 +549,13 @@ preread()
whyles->w_end.type = I_SEEK; whyles->w_end.type = I_SEEK;
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
} }
search(T_BREAK, 0, NULL); /* read the expression in */ search(T_BREAK, 0, NULL); /* read the expression in */
if (setintr) if (setintr)
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
btell(&whyles->w_end); btell(&whyles->w_end);
} }
@ -618,19 +618,19 @@ dorepeat(v, kp)
i = getn(v[1]); i = getn(v[1]);
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
} }
lshift(v, 2); lshift(v, 2);
while (i > 0) { while (i > 0) {
if (setintr) if (setintr)
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
reexecute(kp); reexecute(kp);
--i; --i;
} }
donefds(); donefds();
if (setintr) if (setintr)
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
} }
void void
@ -964,8 +964,8 @@ xecho(sep, v)
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
} }
v++; v++;
if (*v == 0) if (*v == 0)
@ -998,7 +998,7 @@ xecho(sep, v)
else else
(void) fflush(cshout); (void) fflush(cshout);
if (setintr) if (setintr)
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
if (gargv) if (gargv)
blkfree(gargv), gargv = 0; blkfree(gargv), gargv = 0;
} }
@ -1018,8 +1018,8 @@ dosetenv(v, t)
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
} }
for (ep = STR_environ; *ep; ep++) for (ep = STR_environ; *ep; ep++)
(void) fprintf(cshout, "%s\n", vis_str(*ep)); (void) fprintf(cshout, "%s\n", vis_str(*ep));

View File

@ -1,4 +1,4 @@
/* $NetBSD: hist.c,v 1.10 1998/07/28 02:23:39 mycroft Exp $ */ /* $NetBSD: hist.c,v 1.11 1998/07/28 02:47:20 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: hist.c,v 1.10 1998/07/28 02:23:39 mycroft Exp $"); __RCSID("$NetBSD: hist.c,v 1.11 1998/07/28 02:47:20 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -134,8 +134,8 @@ dohist(v, t)
return; return;
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
} }
while (*++v && **v == '-') { while (*++v && **v == '-') {
Char *vp = *v; Char *vp = *v;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lex.c,v 1.13 1998/07/28 02:23:39 mycroft Exp $ */ /* $NetBSD: lex.c,v 1.14 1998/07/28 02:47:20 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)lex.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: lex.c,v 1.13 1998/07/28 02:23:39 mycroft Exp $"); __RCSID("$NetBSD: lex.c,v 1.14 1998/07/28 02:47:20 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -1513,7 +1513,7 @@ again:
goto again; goto again;
} }
if (c > 0) if (c > 0)
memcpy(fbuf[buf] + off, ttyline, c * sizeof(Char)); (void) memcpy(fbuf[buf] + off, ttyline, c * sizeof(Char));
numleft = 0; numleft = 0;
} }
else { else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: misc.c,v 1.10 1998/07/28 02:23:39 mycroft Exp $ */ /* $NetBSD: misc.c,v 1.11 1998/07/28 02:47:20 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: misc.c,v 1.10 1998/07/28 02:23:39 mycroft Exp $"); __RCSID("$NetBSD: misc.c,v 1.11 1998/07/28 02:47:20 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -69,17 +69,6 @@ any(s, c)
return (0); return (0);
} }
void
setzero(cp, i)
char *cp;
int i;
{
if (i != 0)
do
*cp++ = 0;
while (--i);
}
char * char *
strsave(s) strsave(s)
char *s; char *s;

View File

@ -1,4 +1,4 @@
/* $NetBSD: proc.c,v 1.13 1998/07/28 02:23:39 mycroft Exp $ */ /* $NetBSD: proc.c,v 1.14 1998/07/28 02:47:20 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)proc.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: proc.c,v 1.13 1998/07/28 02:23:39 mycroft Exp $"); __RCSID("$NetBSD: proc.c,v 1.14 1998/07/28 02:47:20 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -212,15 +212,15 @@ pnote()
neednote = 0; neednote = 0;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next) { for (pp = proclist.p_next; pp != NULL; pp = pp->p_next) {
if (pp->p_flags & PNEEDNOTE) { if (pp->p_flags & PNEEDNOTE) {
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
pp->p_flags &= ~PNEEDNOTE; pp->p_flags &= ~PNEEDNOTE;
flags = pprint(pp, NUMBER | NAME | REASON); flags = pprint(pp, NUMBER | NAME | REASON);
if ((flags & (PRUNNING | PSTOPPED)) == 0) if ((flags & (PRUNNING | PSTOPPED)) == 0)
pflush(pp); pflush(pp);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
} }
} }
} }
@ -239,8 +239,8 @@ pwait()
* Here's where dead procs get flushed. * Here's where dead procs get flushed.
*/ */
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
for (pp = (fp = &proclist)->p_next; pp != NULL; pp = (fp = pp)->p_next) for (pp = (fp = &proclist)->p_next; pp != NULL; pp = (fp = pp)->p_next)
if (pp->p_pid == 0) { if (pp->p_pid == 0) {
fp->p_next = pp->p_next; fp->p_next = pp->p_next;
@ -251,7 +251,7 @@ pwait()
xfree((ptr_t) pp); xfree((ptr_t) pp);
pp = fp; pp = fp;
} }
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
pjwait(pcurrjob); pjwait(pcurrjob);
} }
@ -282,12 +282,12 @@ pjwait(pp)
*/ */
fp = pp; fp = pp;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
for (;;) { for (;;) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
jobflags = 0; jobflags = 0;
do do
jobflags |= fp->p_flags; jobflags |= fp->p_flags;
@ -299,10 +299,10 @@ pjwait(pp)
fp->p_pid); fp->p_pid);
#endif /* JOBDEBUG */ #endif /* JOBDEBUG */
sigset = osigset; sigset = osigset;
sigdelset(&sigset, SIGCHLD); (void) sigdelset(&sigset, SIGCHLD);
sigsuspend(&sigset); (void) sigsuspend(&sigset);
} }
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
if (tpgrp > 0) /* get tty back */ if (tpgrp > 0) /* get tty back */
(void) tcsetpgrp(FSHTTY, tpgrp); (void) tcsetpgrp(FSHTTY, tpgrp);
if ((jobflags & (PSIGNALED | PSTOPPED | PTIME)) || if ((jobflags & (PSIGNALED | PSTOPPED | PTIME)) ||
@ -367,17 +367,17 @@ dowait(v, t)
pjobs++; pjobs++;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
loop: loop:
for (pp = proclist.p_next; pp; pp = pp->p_next) for (pp = proclist.p_next; pp; pp = pp->p_next)
if (pp->p_pid && /* pp->p_pid == pp->p_jobid && */ if (pp->p_pid && /* pp->p_pid == pp->p_jobid && */
pp->p_flags & PRUNNING) { pp->p_flags & PRUNNING) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigsuspend(&sigset); (void) sigsuspend(&sigset);
goto loop; goto loop;
} }
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
pjobs = 0; pjobs = 0;
} }
@ -1058,10 +1058,10 @@ pkill(v, signum)
Char *cp; Char *cp;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
if (setintr) if (setintr)
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, NULL); (void) sigprocmask(SIG_BLOCK, &sigset, NULL);
gflag = 0, tglob(v); gflag = 0, tglob(v);
if (gflag) { if (gflag) {
v = globall(v); v = globall(v);
@ -1129,7 +1129,7 @@ cont:
} }
if (gargv) if (gargv)
blkfree(gargv), gargv = 0; blkfree(gargv), gargv = 0;
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
if (err1) { if (err1) {
stderror(ERR_SILENT); stderror(ERR_SILENT);
/* NOTREACHED */ /* NOTREACHED */
@ -1149,8 +1149,8 @@ pstart(pp, foregnd)
long jobflags = 0; long jobflags = 0;
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
np = pp; np = pp;
do { do {
jobflags |= np->p_flags; jobflags |= np->p_flags;
@ -1170,7 +1170,7 @@ pstart(pp, foregnd)
(void) tcsetpgrp(FSHTTY, pp->p_jobid); (void) tcsetpgrp(FSHTTY, pp->p_jobid);
if (jobflags & PSTOPPED) if (jobflags & PSTOPPED)
(void) kill(-pp->p_jobid, SIGCONT); (void) kill(-pp->p_jobid, SIGCONT);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
} }
void void
@ -1326,13 +1326,13 @@ pfork(t, wanttty)
* Hold SIGCHLD until we have the process installed in our table. * Hold SIGCHLD until we have the process installed in our table.
*/ */
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
while ((pid = fork()) < 0) while ((pid = fork()) < 0)
if (setintr == 0) if (setintr == 0)
(void) sleep(FORKSLEEP); (void) sleep(FORKSLEEP);
else { else {
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
stderror(ERR_NOPROC); stderror(ERR_NOPROC);
/* NOTREACHED */ /* NOTREACHED */
} }
@ -1377,7 +1377,7 @@ pfork(t, wanttty)
if (wanttty >= 0) if (wanttty >= 0)
(void) setpgid(pid, pcurrjob ? pcurrjob->p_jobid : pid); (void) setpgid(pid, pcurrjob ? pcurrjob->p_jobid : pid);
palloc(pid, t); palloc(pid, t);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
} }
return (pid); return (pid);
@ -1413,10 +1413,10 @@ pgetty(wanttty, pgrp)
*/ */
if (wanttty > 0) { if (wanttty > 0) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGTSTP); (void) sigaddset(&sigset, SIGTSTP);
sigaddset(&sigset, SIGTTIN); (void) sigaddset(&sigset, SIGTTIN);
sigaddset(&sigset, SIGTTOU); (void) sigaddset(&sigset, SIGTTOU);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
} }
/* /*
* From: Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de> * From: Michael Schroeder <mlschroe@immd4.informatik.uni-erlangen.de>
@ -1433,7 +1433,7 @@ pgetty(wanttty, pgrp)
if (wanttty > 0) { if (wanttty > 0) {
(void) tcsetpgrp(FSHTTY, pgrp); (void) tcsetpgrp(FSHTTY, pgrp);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
} }
if (tpgrp > 0) if (tpgrp > 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: sem.c,v 1.12 1998/07/28 02:23:39 mycroft Exp $ */ /* $NetBSD: sem.c,v 1.13 1998/07/28 02:47:21 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)sem.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)sem.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: sem.c,v 1.12 1998/07/28 02:23:39 mycroft Exp $"); __RCSID("$NetBSD: sem.c,v 1.13 1998/07/28 02:47:21 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -217,14 +217,14 @@ execute(t, wanttty, pipein, pipeout)
*/ */
if (wanttty >= 0 && !nosigchld) { if (wanttty >= 0 && !nosigchld) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &csigset); (void) sigprocmask(SIG_BLOCK, &sigset, &csigset);
nosigchld = 1; nosigchld = 1;
} }
pid = pfork(t, wanttty); pid = pfork(t, wanttty);
if (pid == 0 && nosigchld) { if (pid == 0 && nosigchld) {
sigprocmask(SIG_SETMASK, &csigset, NULL); (void) sigprocmask(SIG_SETMASK, &csigset, NULL);
nosigchld = 0; nosigchld = 0;
} }
else if (pid != 0 && (t->t_dflg & F_AMPERSAND)) else if (pid != 0 && (t->t_dflg & F_AMPERSAND))
@ -246,14 +246,14 @@ execute(t, wanttty, pipein, pipeout)
*/ */
if (wanttty >= 0 && !nosigchld && !noexec) { if (wanttty >= 0 && !nosigchld && !noexec) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigprocmask(SIG_BLOCK, &sigset, &csigset); (void) sigprocmask(SIG_BLOCK, &sigset, &csigset);
nosigchld = 1; nosigchld = 1;
} }
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGCHLD); (void) sigaddset(&sigset, SIGCHLD);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_BLOCK, &sigset, &osigset); (void) sigprocmask(SIG_BLOCK, &sigset, &osigset);
ochild = child; ochild = child;
osetintr = setintr; osetintr = setintr;
ohaderr = haderr; ohaderr = haderr;
@ -271,7 +271,7 @@ execute(t, wanttty, pipein, pipeout)
pid = vfork(); pid = vfork();
if (pid < 0) { if (pid < 0) {
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
stderror(ERR_NOPROC); stderror(ERR_NOPROC);
/* NOTREACHED */ /* NOTREACHED */
} }
@ -299,7 +299,7 @@ execute(t, wanttty, pipein, pipeout)
Vt = 0; Vt = 0;
/* this is from pfork() */ /* this is from pfork() */
palloc(pid, t); palloc(pid, t);
sigprocmask(SIG_SETMASK, &osigset, NULL); (void) sigprocmask(SIG_SETMASK, &osigset, NULL);
} }
else { /* child */ else { /* child */
/* this is from pfork() */ /* this is from pfork() */
@ -307,7 +307,7 @@ execute(t, wanttty, pipein, pipeout)
bool ignint = 0; bool ignint = 0;
if (nosigchld) { if (nosigchld) {
sigprocmask(SIG_SETMASK, &csigset, NULL); (void) sigprocmask(SIG_SETMASK, &csigset, NULL);
nosigchld = 0; nosigchld = 0;
} }
@ -364,7 +364,7 @@ execute(t, wanttty, pipein, pipeout)
} }
if ((t->t_dflg & F_PIPEOUT) == 0) { if ((t->t_dflg & F_PIPEOUT) == 0) {
if (nosigchld) { if (nosigchld) {
sigprocmask(SIG_SETMASK, &csigset, NULL); (void) sigprocmask(SIG_SETMASK, &csigset, NULL);
nosigchld = 0; nosigchld = 0;
} }
if ((t->t_dflg & F_AMPERSAND) == 0) if ((t->t_dflg & F_AMPERSAND) == 0)

View File

@ -1,4 +1,4 @@
/* $NetBSD: set.c,v 1.11 1998/07/28 02:23:40 mycroft Exp $ */ /* $NetBSD: set.c,v 1.12 1998/07/28 02:47:21 mycroft Exp $ */
/*- /*-
* Copyright (c) 1980, 1991, 1993 * Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
#else #else
__RCSID("$NetBSD: set.c,v 1.11 1998/07/28 02:23:40 mycroft Exp $"); __RCSID("$NetBSD: set.c,v 1.12 1998/07/28 02:47:21 mycroft Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -854,8 +854,8 @@ plist(p)
if (setintr) { if (setintr) {
sigemptyset(&sigset); sigemptyset(&sigset);
sigaddset(&sigset, SIGINT); (void) sigaddset(&sigset, SIGINT);
sigprocmask(SIG_UNBLOCK, &sigset, NULL); (void) sigprocmask(SIG_UNBLOCK, &sigset, NULL);
} }
for (;;) { for (;;) {