Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Feb 2011 16:40:50 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r218285 - in head: bin/kill bin/pkill bin/sh lib/libc/gen usr.bin/killall usr.bin/truss
Message-ID:  <201102041640.p14Geowb090904@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Fri Feb  4 16:40:50 2011
New Revision: 218285
URL: http://svn.freebsd.org/changeset/base/218285

Log:
  Make sys_signame upper case.
  
  This matches the constants from <signal.h> 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'.

Modified:
  head/bin/kill/kill.c
  head/bin/pkill/pkill.c
  head/bin/sh/trap.c
  head/lib/libc/gen/psignal.3
  head/lib/libc/gen/siglist.c
  head/usr.bin/killall/killall.c
  head/usr.bin/truss/main.c

Modified: head/bin/kill/kill.c
==============================================================================
--- head/bin/kill/kill.c	Fri Feb  4 16:32:34 2011	(r218284)
+++ head/bin/kill/kill.c	Fri Feb  4 16:40:50 2011	(r218285)
@@ -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))

Modified: head/bin/pkill/pkill.c
==============================================================================
--- head/bin/pkill/pkill.c	Fri Feb  4 16:32:34 2011	(r218284)
+++ head/bin/pkill/pkill.c	Fri Feb  4 16:40:50 2011	(r218285)
@@ -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)

Modified: head/bin/sh/trap.c
==============================================================================
--- head/bin/sh/trap.c	Fri Feb  4 16:32:34 2011	(r218284)
+++ head/bin/sh/trap.c	Fri Feb  4 16:40:50 2011	(r218285)
@@ -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 {

Modified: head/lib/libc/gen/psignal.3
==============================================================================
--- head/lib/libc/gen/psignal.3	Fri Feb  4 16:32:34 2011	(r218284)
+++ head/lib/libc/gen/psignal.3	Fri Feb  4 16:40:50 2011	(r218285)
@@ -28,7 +28,7 @@
 .\"     @(#)psignal.3	8.2 (Berkeley) 2/27/95
 .\" $FreeBSD$
 .\"
-.Dd February 27, 1995
+.Dd February 4, 2011
 .Dt PSIGNAL 3
 .Os
 .Sh NAME
@@ -89,7 +89,7 @@ indexed by recognized signal numbers.
 The external array
 .Va sys_signame
 is used similarly and
-contains short, lower-case abbreviations for signals
+contains short, upper-case abbreviations for signals
 which are useful for recognizing signal names
 in user input.
 The defined variable

Modified: head/lib/libc/gen/siglist.c
==============================================================================
--- head/lib/libc/gen/siglist.c	Fri Feb  4 16:32:34 2011	(r218284)
+++ head/lib/libc/gen/siglist.c	Fri Feb  4 16:40:50 2011	(r218285)
@@ -37,37 +37,37 @@ __FBSDID("$FreeBSD$");
 
 const char *const sys_signame[NSIG] = {
 	"Signal 0",
-	"hup",				/* SIGHUP */
-	"int",				/* SIGINT */
-	"quit",				/* SIGQUIT */
-	"ill",				/* SIGILL */
-	"trap",				/* SIGTRAP */
-	"abrt",				/* SIGABRT */
-	"emt",				/* SIGEMT */
-	"fpe",				/* SIGFPE */
-	"kill",				/* SIGKILL */
-	"bus",				/* SIGBUS */
-	"segv",				/* SIGSEGV */
-	"sys",				/* SIGSYS */
-	"pipe",				/* SIGPIPE */
-	"alrm",				/* SIGALRM */
-	"term",				/* SIGTERM */
-	"urg",				/* SIGURG */
-	"stop",				/* SIGSTOP */
-	"tstp",				/* SIGTSTP */
-	"cont",				/* SIGCONT */
-	"chld",				/* SIGCHLD */
-	"ttin",				/* SIGTTIN */
-	"ttou",				/* SIGTTOU */
-	"io",				/* SIGIO */
-	"xcpu",				/* SIGXCPU */
-	"xfsz",				/* SIGXFSZ */
-	"vtalrm",			/* SIGVTALRM */
-	"prof",				/* SIGPROF */
-	"winch",			/* SIGWINCH */
-	"info",				/* SIGINFO */
-	"usr1",				/* SIGUSR1 */
-	"usr2"				/* SIGUSR2 */
+	"HUP",				/* SIGHUP */
+	"INT",				/* SIGINT */
+	"QUIT",				/* SIGQUIT */
+	"ILL",				/* SIGILL */
+	"TRAP",				/* SIGTRAP */
+	"ABRT",				/* SIGABRT */
+	"EMT",				/* SIGEMT */
+	"FPE",				/* SIGFPE */
+	"KILL",				/* SIGKILL */
+	"BUS",				/* SIGBUS */
+	"SEGV",				/* SIGSEGV */
+	"SYS",				/* SIGSYS */
+	"PIPE",				/* SIGPIPE */
+	"ALRM",				/* SIGALRM */
+	"TERM",				/* SIGTERM */
+	"URG",				/* SIGURG */
+	"STOP",				/* SIGSTOP */
+	"TSTP",				/* SIGTSTP */
+	"CONT",				/* SIGCONT */
+	"CHLD",				/* SIGCHLD */
+	"TTIN",				/* SIGTTIN */
+	"TTOU",				/* SIGTTOU */
+	"IO",				/* SIGIO */
+	"XCPU",				/* SIGXCPU */
+	"XFSZ",				/* SIGXFSZ */
+	"VTALRM",			/* SIGVTALRM */
+	"PROF",				/* SIGPROF */
+	"WINCH",			/* SIGWINCH */
+	"INFO",				/* SIGINFO */
+	"USR1",				/* SIGUSR1 */
+	"USR2"				/* SIGUSR2 */
 };
 
 const char *const sys_siglist[NSIG] = {

Modified: head/usr.bin/killall/killall.c
==============================================================================
--- head/usr.bin/killall/killall.c	Fri Feb  4 16:32:34 2011	(r218284)
+++ head/usr.bin/killall/killall.c	Fri Feb  4 16:40:50 2011	(r218285)
@@ -218,7 +218,7 @@ main(int ac, char **av)
 				break;
 			default:
 				if (isalpha((unsigned char)**av)) {
-					if (strncasecmp(*av, "sig", 3) == 0)
+					if (strncasecmp(*av, "SIG", 3) == 0)
 						*av += 3;
 					for (sig = NSIG, p = sys_signame + 1;
 					     --sig; ++p)

Modified: head/usr.bin/truss/main.c
==============================================================================
--- head/usr.bin/truss/main.c	Fri Feb  4 16:32:34 2011	(r218284)
+++ head/usr.bin/truss/main.c	Fri Feb  4 16:40:50 2011	(r218285)
@@ -155,7 +155,7 @@ strsig(int sig)
 	ret = NULL;
 	if (sig > 0 && sig < NSIG) {
 		int i;
-		asprintf(&ret, "sig%s", sys_signame[sig]);
+		asprintf(&ret, "SIG%s", sys_signame[sig]);
 		if (ret == NULL)
 			return (NULL);
 		for (i = 0; ret[i] != '\0'; ++i)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102041640.p14Geowb090904>