summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-03-06 19:50:47 +0000
committerjilles <jilles@FreeBSD.org>2011-03-06 19:50:47 +0000
commitf046771b043f97ce73ec41945b3cba415de5e51e (patch)
tree7aaa71e2355dcbf9728fcac1d7dc084775764b64 /usr.bin
parentafeb46924f240d98faa8d6db6392cea23842af0a (diff)
downloadFreeBSD-src-f046771b043f97ce73ec41945b3cba415de5e51e.zip
FreeBSD-src-f046771b043f97ce73ec41945b3cba415de5e51e.tar.gz
Simplify various code that allowed for sys_signame being lower case.
This was changed in r218285.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/killall/killall.c19
-rw-r--r--usr.bin/truss/main.c4
2 files changed, 3 insertions, 20 deletions
diff --git a/usr.bin/killall/killall.c b/usr.bin/killall/killall.c
index 2342a32..28496a0 100644
--- a/usr.bin/killall/killall.c
+++ b/usr.bin/killall/killall.c
@@ -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;
}
}
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c
index 58ed5d5..e828046 100644
--- a/usr.bin/truss/main.c
+++ b/usr.bin/truss/main.c
@@ -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);
}
OpenPOWER on IntegriCloud