Date: Sun, 6 Mar 2011 19:50:47 +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: r219347 - in head/usr.bin: killall truss Message-ID: <201103061950.p26Jolbt007952@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Sun Mar 6 19:50:47 2011 New Revision: 219347 URL: http://svn.freebsd.org/changeset/base/219347 Log: Simplify various code that allowed for sys_signame being lower case. This was changed in r218285. Modified: head/usr.bin/killall/killall.c head/usr.bin/truss/main.c Modified: head/usr.bin/killall/killall.c ============================================================================== --- head/usr.bin/killall/killall.c Sun Mar 6 19:47:46 2011 (r219346) +++ head/usr.bin/killall/killall.c Sun Mar 6 19:50:47 2011 (r219347) @@ -60,18 +60,6 @@ usage(void) exit(1); } -static char * -upper(const char *str) -{ - static char buf[80]; - char *s; - - strlcpy(buf, str, sizeof(buf)); - for (s = buf; *s; s++) - *s = toupper((unsigned char)*s); - return buf; -} - static void printsig(FILE *fp) @@ -81,7 +69,7 @@ printsig(FILE *fp) int offset = 0; for (cnt = NSIG, p = sys_signame + 1; --cnt; ++p) { - offset += fprintf(fp, "%s ", upper(*p)); + offset += fprintf(fp, "%s ", *p); if (offset >= 75 && cnt > 1) { offset = 0; fprintf(fp, "\n"); @@ -401,14 +389,13 @@ main(int ac, char **av) thiscmd, thispid, thistdev, thisuid); if (vflag || sflag) - printf("kill -%s %d\n", upper(sys_signame[sig]), - thispid); + printf("kill -%s %d\n", sys_signame[sig], thispid); killed++; if (!dflag && !sflag) { if (kill(thispid, sig) < 0 /* && errno != ESRCH */ ) { warn("warning: kill -%s %d", - upper(sys_signame[sig]), thispid); + sys_signame[sig], thispid); errors = 1; } } Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Sun Mar 6 19:47:46 2011 (r219346) +++ head/usr.bin/truss/main.c Sun Mar 6 19:50:47 2011 (r219347) @@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$"); #include <sys/sysctl.h> #include <sys/wait.h> -#include <ctype.h> #include <err.h> #include <errno.h> #include <fcntl.h> @@ -154,12 +153,9 @@ strsig(int sig) ret = NULL; if (sig > 0 && sig < NSIG) { - int i; asprintf(&ret, "SIG%s", sys_signame[sig]); if (ret == NULL) return (NULL); - for (i = 0; ret[i] != '\0'; ++i) - ret[i] = toupper(ret[i]); } return (ret); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103061950.p26Jolbt007952>