summaryrefslogtreecommitdiff
path: root/usr.bin/vi/ex
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-11-10 21:31:43 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-11-10 21:31:43 +0000
commit456458354e0f26749ebfde9f8ded879c5209458f (patch)
tree63b679b116bcd17307dae3856ce0a0295fda2bc1 /usr.bin/vi/ex
parent4c214b022e274a365f1b7dc397f26d7c55a07714 (diff)
remove old, unnecessary compat code. from Martin Natano
Diffstat (limited to 'usr.bin/vi/ex')
-rw-r--r--usr.bin/vi/ex/ex_shell.c171
1 files changed, 2 insertions, 169 deletions
diff --git a/usr.bin/vi/ex/ex_shell.c b/usr.bin/vi/ex/ex_shell.c
index d9f57da852d..ce7d1e0b623 100644
--- a/usr.bin/vi/ex/ex_shell.c
+++ b/usr.bin/vi/ex/ex_shell.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ex_shell.c,v 1.11 2009/10/27 23:59:47 deraadt Exp $ */
+/* $OpenBSD: ex_shell.c,v 1.12 2014/11/10 21:31:42 tedu Exp $ */
/*-
* Copyright (c) 1992, 1993, 1994
@@ -26,8 +26,6 @@
#include "../common/common.h"
-static const char *sigmsg(int);
-
/*
* ex_shell -- :sh[ell]
* Invoke the program named in the SHELL environment variable
@@ -179,7 +177,7 @@ proc_wait(sp, pid, cmd, silent, okpipe)
len = strlen(p);
msgq(sp, M_ERR, "%.*s%s: received signal: %s%s",
MIN(len, 20), p, len > 20 ? " ..." : "",
- sigmsg(WTERMSIG(pstat)),
+ strsignal(WTERMSIG(pstat)),
WCOREDUMP(pstat) ? "; core dumped" : "");
if (nf)
FREE_SPACE(sp, p, 0);
@@ -209,168 +207,3 @@ proc_wait(sp, pid, cmd, silent, okpipe)
}
return (0);
}
-
-/*
- * XXX
- * The sys_siglist[] table in the C library has this information, but there's
- * no portable way to get to it. (Believe me, I tried.)
- */
-typedef struct _sigs {
- int number; /* signal number */
- char *message; /* related message */
-} SIGS;
-
-SIGS const sigs[] = {
-#ifdef SIGABRT
- { SIGABRT, "Abort trap" },
-#endif
-#ifdef SIGALRM
- { SIGALRM, "Alarm clock" },
-#endif
-#ifdef SIGBUS
- { SIGBUS, "Bus error" },
-#endif
-#ifdef SIGCLD
- { SIGCLD, "Child exited or stopped" },
-#endif
-#ifdef SIGCHLD
- { SIGCHLD, "Child exited" },
-#endif
-#ifdef SIGCONT
- { SIGCONT, "Continued" },
-#endif
-#ifdef SIGDANGER
- { SIGDANGER, "System crash imminent" },
-#endif
-#ifdef SIGEMT
- { SIGEMT, "EMT trap" },
-#endif
-#ifdef SIGFPE
- { SIGFPE, "Floating point exception" },
-#endif
-#ifdef SIGGRANT
- { SIGGRANT, "HFT monitor mode granted" },
-#endif
-#ifdef SIGHUP
- { SIGHUP, "Hangup" },
-#endif
-#ifdef SIGILL
- { SIGILL, "Illegal instruction" },
-#endif
-#ifdef SIGINFO
- { SIGINFO, "Information request" },
-#endif
-#ifdef SIGINT
- { SIGINT, "Interrupt" },
-#endif
-#ifdef SIGIO
- { SIGIO, "I/O possible" },
-#endif
-#ifdef SIGIOT
- { SIGIOT, "IOT trap" },
-#endif
-#ifdef SIGKILL
- { SIGKILL, "Killed" },
-#endif
-#ifdef SIGLOST
- { SIGLOST, "Record lock" },
-#endif
-#ifdef SIGMIGRATE
- { SIGMIGRATE, "Migrate process to another CPU" },
-#endif
-#ifdef SIGMSG
- { SIGMSG, "HFT input data pending" },
-#endif
-#ifdef SIGPIPE
- { SIGPIPE, "Broken pipe" },
-#endif
-#ifdef SIGPOLL
- { SIGPOLL, "I/O possible" },
-#endif
-#ifdef SIGPRE
- { SIGPRE, "Programming error" },
-#endif
-#ifdef SIGPROF
- { SIGPROF, "Profiling timer expired" },
-#endif
-#ifdef SIGPWR
- { SIGPWR, "Power failure imminent" },
-#endif
-#ifdef SIGRETRACT
- { SIGRETRACT, "HFT monitor mode retracted" },
-#endif
-#ifdef SIGQUIT
- { SIGQUIT, "Quit" },
-#endif
-#ifdef SIGSAK
- { SIGSAK, "Secure Attention Key" },
-#endif
-#ifdef SIGSEGV
- { SIGSEGV, "Segmentation fault" },
-#endif
-#ifdef SIGSOUND
- { SIGSOUND, "HFT sound sequence completed" },
-#endif
-#ifdef SIGSTOP
- { SIGSTOP, "Suspended (signal)" },
-#endif
-#ifdef SIGSYS
- { SIGSYS, "Bad system call" },
-#endif
-#ifdef SIGTERM
- { SIGTERM, "Terminated" },
-#endif
-#ifdef SIGTRAP
- { SIGTRAP, "Trace/BPT trap" },
-#endif
-#ifdef SIGTSTP
- { SIGTSTP, "Suspended" },
-#endif
-#ifdef SIGTTIN
- { SIGTTIN, "Stopped (tty input)" },
-#endif
-#ifdef SIGTTOU
- { SIGTTOU, "Stopped (tty output)" },
-#endif
-#ifdef SIGURG
- { SIGURG, "Urgent I/O condition" },
-#endif
-#ifdef SIGUSR1
- { SIGUSR1, "User defined signal 1" },
-#endif
-#ifdef SIGUSR2
- { SIGUSR2, "User defined signal 2" },
-#endif
-#ifdef SIGVTALRM
- { SIGVTALRM, "Virtual timer expired" },
-#endif
-#ifdef SIGWINCH
- { SIGWINCH, "Window size changes" },
-#endif
-#ifdef SIGXCPU
- { SIGXCPU, "Cputime limit exceeded" },
-#endif
-#ifdef SIGXFSZ
- { SIGXFSZ, "Filesize limit exceeded" },
-#endif
-};
-
-/*
- * sigmsg --
- * Return a pointer to a message describing a signal.
- */
-static const char *
-sigmsg(signo)
- int signo;
-{
- static char buf[40];
- const SIGS *sigp;
- int n;
-
- for (n = 0,
- sigp = &sigs[0]; n < sizeof(sigs) / sizeof(sigs[0]); ++n, ++sigp)
- if (sigp->number == signo)
- return (sigp->message);
- (void)snprintf(buf, sizeof(buf), "Unknown signal: %d", signo);
- return (buf);
-}