- strsignal.patch: use strsignal instead of sys_siglist OBS-URL: https://build.opensuse.org/request/show/830858 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/kbuild?expand=0&rev=48
77 lines
2.1 KiB
Diff
77 lines
2.1 KiB
Diff
------------------------------------------------------------------------
|
|
r3408 | bird | 2020-08-13 11:01:14 +0200 (Do, 13 Aug 2020) | 1 line
|
|
|
|
kash: Don't use sys_siglist, use strsignal instead. Should be present everywhere except when using VC++ on windows.
|
|
------------------------------------------------------------------------
|
|
Index: src/kash/jobs.c
|
|
===================================================================
|
|
--- src/kash/jobs.c (revision 3407)
|
|
+++ src/kash/jobs.c (revision 3408)
|
|
@@ -389,6 +389,7 @@
|
|
else
|
|
fmtstr(s + col, 16, "Done");
|
|
} else {
|
|
+ const char *pszSigNm;
|
|
#if JOBS
|
|
if (WIFSTOPPED(ps->status))
|
|
st = WSTOPSIG(ps->status);
|
|
@@ -396,8 +397,9 @@
|
|
#endif
|
|
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);
|
|
if (WCOREDUMP(ps->status)) {
|
|
Index: src/kash/shinstance.h
|
|
===================================================================
|
|
--- src/kash/shinstance.h (revision 3407)
|
|
+++ src/kash/shinstance.h (revision 3408)
|
|
@@ -380,12 +380,8 @@
|
|
# define SIGCONT 20
|
|
/*# 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];
|
|
#endif
|
|
Index: src/kash/sys_signame.c
|
|
===================================================================
|
|
--- src/kash/sys_signame.c (revision 3407)
|
|
+++ src/kash/sys_signame.c (revision 3408)
|
|
@@ -11,7 +11,7 @@
|
|
|
|
void init_sys_signame(void)
|
|
{
|
|
- unsigned i;
|
|
+ unsigned i;
|
|
if (sys_signame_initialized)
|
|
return;
|
|
for (i = 0; i < NSIG; ++i)
|
|
@@ -119,3 +119,15 @@
|
|
#undef SET_SIG_STR
|
|
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
|
|
+
|