From dbecc33067971cfd38a340e4435a163832f7601d Mon Sep 17 00:00:00 2001 From: jilles Date: Fri, 4 Feb 2011 16:40:50 +0000 Subject: Make sys_signame upper case. This matches the constants from with 'SIG' removed, which POSIX requires kill and trap to accept and 'kill -l' to write. 'kill -l', 'trap', 'trap -l' output is now upper case. In Turkish locales, signal names with an upper case 'I' are now accepted, while signal names with a lower case 'i' are no longer accepted, and the output of 'killall -l' now contains proper capital 'I' without dot instead of a dotted capital 'I'. --- bin/kill/kill.c | 2 +- bin/pkill/pkill.c | 2 +- bin/sh/trap.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/kill/kill.c b/bin/kill/kill.c index edfc928..69ad0c8 100644 --- a/bin/kill/kill.c +++ b/bin/kill/kill.c @@ -152,7 +152,7 @@ signame_to_signum(const char *sig) { int n; - if (!strncasecmp(sig, "sig", (size_t)3)) + if (!strncasecmp(sig, "SIG", (size_t)3)) sig += 3; for (n = 1; n < sys_nsig; n++) { if (!strcasecmp(sys_signame[n], sig)) diff --git a/bin/pkill/pkill.c b/bin/pkill/pkill.c index d9959c58..cd91976 100644 --- a/bin/pkill/pkill.c +++ b/bin/pkill/pkill.c @@ -156,7 +156,7 @@ main(int argc, char **argv) argv++; argc--; } else { - if (strncasecmp(p, "sig", 3) == 0) + if (strncasecmp(p, "SIG", 3) == 0) p += 3; for (i = 1; i < NSIG; i++) if (strcasecmp(sys_signame[i], p) == 0) diff --git a/bin/sh/trap.c b/bin/sh/trap.c index 048c75c..3ddd5a9 100644 --- a/bin/sh/trap.c +++ b/bin/sh/trap.c @@ -101,12 +101,12 @@ sigstring_to_signum(char *sig) signo = atoi(sig); return ((signo >= 0 && signo < NSIG) ? signo : (-1)); - } else if (strcasecmp(sig, "exit") == 0) { + } else if (strcasecmp(sig, "EXIT") == 0) { return (0); } else { int n; - if (strncasecmp(sig, "sig", 3) == 0) + if (strncasecmp(sig, "SIG", 3) == 0) sig += 3; for (n = 1; n < sys_nsig; n++) if (sys_signame[n] && @@ -171,7 +171,7 @@ trapcmd(int argc, char **argv) out1str("trap -- "); out1qstr(trap[signo]); if (signo == 0) { - out1str(" exit\n"); + out1str(" EXIT\n"); } else if (sys_signame[signo]) { out1fmt(" %s\n", sys_signame[signo]); } else { -- cgit v1.1