From 3e8da0cdfa07ae37d3d529cb4fb8aebdcec14e948e1648364910bd6972644340 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 31 Aug 2020 14:53:48 +0000 Subject: [PATCH] Accepting request 830858 from home:Andreas_Schwab:Factory - 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 --- kbuild.changes | 5 ++++ kbuild.spec | 2 ++ strsignal.patch | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 strsignal.patch diff --git a/kbuild.changes b/kbuild.changes index bb2f4a0..633488c 100644 --- a/kbuild.changes +++ b/kbuild.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 31 14:25:14 UTC 2020 - Andreas Schwab + +- strsignal.patch: use strsignal instead of sys_siglist + ------------------------------------------------------------------- Fri Apr 3 05:46:51 UTC 2020 - Martin Liška diff --git a/kbuild.spec b/kbuild.spec index 0a264fd..6a4665a 100644 --- a/kbuild.spec +++ b/kbuild.spec @@ -40,6 +40,7 @@ Patch12: use-alloca.patch Patch13: glob-lstat.patch Patch14: glob-interface.patch Patch15: gcc10-fno-common-fix.patch +Patch16: strsignal.patch BuildRequires: automake BuildRequires: bison BuildRequires: flex @@ -76,6 +77,7 @@ The goals of the kBuild framework: %patch13 -p1 %patch14 -p1 %patch15 -p1 +%patch16 %build export CFLAGS="%{optflags}" diff --git a/strsignal.patch b/strsignal.patch new file mode 100644 index 0000000..ec1f3e2 --- /dev/null +++ b/strsignal.patch @@ -0,0 +1,76 @@ +------------------------------------------------------------------------ +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 ++