1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
http://trac.netlabs.org/kbuild/changeset?format=diff&new=3408&old=3407&new_path=%2Ftrunk&old_path=%2Ftrunk
--- a/src/kash/jobs.c
+++ b/src/kash/jobs.c
@@ -390,4 +390,5 @@
fmtstr(s + col, 16, "Done");
} else {
+ const char *pszSigNm;
#if JOBS
if (WIFSTOPPED(ps->status))
@@ -397,6 +398,7 @@
st = WTERMSIG(ps->status);
st &= 0x7f;
- if (st < NSIG && sys_siglist[st])
- scopyn(sys_siglist[st], s + col, 32);
+ pszSigNm = st < NSIG ? strsignal(st) : NULL;
+ if (pszSigNm)
+ scopyn(pszSigNm, s + col, 32);
else
fmtstr(s + col, 16, "Signal %d", st);
--- a/src/kash/shinstance.h
+++ b/src/kash/shinstance.h
@@ -381,10 +381,6 @@
/*# define SIGBREAK 21 */
/*# define SIGABRT 22 */
-
-# define sys_siglist sys_signame
+const char *strsignal(int iSig);
#endif /* _MSC_VER */
-#ifdef __sun__
-# define sys_siglist _sys_siglist
-#endif
#ifndef HAVE_SYS_SIGNAME
extern char sys_signame[NSIG][16];
--- a/src/kash/sys_signame.c
+++ b/src/kash/sys_signame.c
@@ -12,5 +12,5 @@
void init_sys_signame(void)
{
- unsigned i;
+ unsigned i;
if (sys_signame_initialized)
return;
@@ -120,2 +120,14 @@
sys_signame_initialized = 1;
}
+
+#if defined(_MSC_VER)
+const char *strsignal(int iSig)
+{
+ if (!sys_signame_initialized)
+ init_sys_signame();
+ if (iSig < NSIG)
+ return sys_signame(iSig);
+ return NULL;
+}
+#endif
+
|