Use libc's sys_siglist[] instead of building and using our own array of
signal names. (from charles)
This commit is contained in:
parent
3ba09ffc0a
commit
1e9eba5d40
@ -4,15 +4,15 @@ PROG= sh
|
||||
SRCS= alias.c builtins.c cd.c echo.c error.c eval.c exec.c expand.c \
|
||||
histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
|
||||
mystring.c nodes.c options.c parser.c redir.c show.c \
|
||||
signames.c syntax.c trap.c output.c var.c
|
||||
syntax.c trap.c output.c var.c
|
||||
OBJS+= init.o arith.o arith_lex.o
|
||||
LDADD= -ll -ledit -ltermcap -lcompat
|
||||
LFLAGS= -8 # 8-bit lex scanner for arithmetic
|
||||
CFLAGS+=-DSHELL -I. -I${.CURDIR}
|
||||
.PATH: ${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf
|
||||
CLEANFILES+=\
|
||||
builtins.c builtins.h init.c mkinit mknodes mksignames mksyntax \
|
||||
nodes.c nodes.h signames.c signames.h syntax.c syntax.h token.def \
|
||||
builtins.c builtins.h init.c mkinit mknodes mksyntax \
|
||||
nodes.c nodes.h syntax.c syntax.h token.def \
|
||||
y.tab.h
|
||||
|
||||
.depend parser.o: token.def
|
||||
@ -34,12 +34,6 @@ nodes.c nodes.h: mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
|
||||
mknodes: ${.CURDIR}/mknodes.c
|
||||
${CC} ${CFLAGS} ${.CURDIR}/mknodes.c -o $@
|
||||
|
||||
signames.c signames.h: mksignames
|
||||
./mksignames
|
||||
|
||||
mksignames: ${.CURDIR}/mksignames.c
|
||||
${CC} ${CFLAGS} ${.CURDIR}/mksignames.c -o $@
|
||||
|
||||
syntax.c syntax.h: mksyntax
|
||||
./mksyntax
|
||||
|
||||
|
@ -49,7 +49,6 @@ static char sccsid[] = "@(#)jobs.c 8.1 (Berkeley) 5/31/93";
|
||||
#include "jobs.h"
|
||||
#include "options.h"
|
||||
#include "trap.h"
|
||||
#include "signames.h"
|
||||
#include "syntax.h"
|
||||
#include "input.h"
|
||||
#include "output.h"
|
||||
@ -59,6 +58,7 @@ static char sccsid[] = "@(#)jobs.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#ifdef BSD
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
@ -272,8 +272,8 @@ showjobs(change) {
|
||||
if ((i & 0xFF) == 0177)
|
||||
i >>= 8;
|
||||
#endif
|
||||
if ((i & 0x7F) <= MAXSIG && sigmesg[i & 0x7F])
|
||||
scopy(sigmesg[i & 0x7F], s);
|
||||
if ((i & 0x7F) < NSIG && sys_siglist[i & 0x7F])
|
||||
scopy(sys_siglist[i & 0x7F], s);
|
||||
else
|
||||
fmtstr(s, 64, "Signal %d", i & 0x7F);
|
||||
if (i & 0x80)
|
||||
@ -736,8 +736,8 @@ dowait(block, job)
|
||||
if (status == SIGTSTP && rootshell && iflag)
|
||||
outfmt(out2, "%%%d ", job - jobtab + 1);
|
||||
#endif
|
||||
if (status <= MAXSIG && sigmesg[status])
|
||||
out2str(sigmesg[status]);
|
||||
if (status < NSIG && sys_siglist[status])
|
||||
out2str(sys_siglist[status]);
|
||||
else
|
||||
outfmt(out2, "Signal %d", status);
|
||||
if (core)
|
||||
|
Loading…
Reference in New Issue
Block a user