Deleted Added
full compact
killall.c (132192) killall.c (132193)
1/*-
2 * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
3 * Copyright (c) 2000 Paul Saab <ps@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Peter Wemm <peter@FreeBSD.org>
3 * Copyright (c) 2000 Paul Saab <ps@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/usr.bin/killall/killall.c 132192 2004-07-15 07:30:15Z tjr $");
29__FBSDID("$FreeBSD: head/usr.bin/killall/killall.c 132193 2004-07-15 07:33:56Z tjr $");
30
31#include <sys/param.h>
32#include <sys/jail.h>
33#include <sys/stat.h>
34#include <sys/user.h>
35#include <sys/sysctl.h>
36#include <fcntl.h>
37#include <dirent.h>

--- 24 unchanged lines hidden (view full) ---

62upper(const char *str)
63{
64 static char buf[80];
65 char *s;
66
67 strncpy(buf, str, sizeof(buf));
68 buf[sizeof(buf) - 1] = '\0';
69 for (s = buf; *s; s++)
30
31#include <sys/param.h>
32#include <sys/jail.h>
33#include <sys/stat.h>
34#include <sys/user.h>
35#include <sys/sysctl.h>
36#include <fcntl.h>
37#include <dirent.h>

--- 24 unchanged lines hidden (view full) ---

62upper(const char *str)
63{
64 static char buf[80];
65 char *s;
66
67 strncpy(buf, str, sizeof(buf));
68 buf[sizeof(buf) - 1] = '\0';
69 for (s = buf; *s; s++)
70 *s = toupper(*s);
70 *s = toupper((unsigned char)*s);
71 return buf;
72}
73
74
75static void
76printsig(FILE *fp)
77{
78 const char *const * p;

--- 122 unchanged lines hidden (view full) ---

201 break;
202 case 'm':
203 mflag++;
204 break;
205 case 'z':
206 zflag++;
207 break;
208 default:
71 return buf;
72}
73
74
75static void
76printsig(FILE *fp)
77{
78 const char *const * p;

--- 122 unchanged lines hidden (view full) ---

201 break;
202 case 'm':
203 mflag++;
204 break;
205 case 'z':
206 zflag++;
207 break;
208 default:
209 if (isalpha(**av)) {
209 if (isalpha((unsigned char)**av)) {
210 if (strncasecmp(*av, "sig", 3) == 0)
211 *av += 3;
212 for (sig = NSIG, p = sys_signame + 1;
213 --sig; ++p)
214 if (strcasecmp(*p, *av) == 0) {
215 sig = p - sys_signame;
216 break;
217 }
218 if (!sig)
219 nosig(*av);
210 if (strncasecmp(*av, "sig", 3) == 0)
211 *av += 3;
212 for (sig = NSIG, p = sys_signame + 1;
213 --sig; ++p)
214 if (strcasecmp(*p, *av) == 0) {
215 sig = p - sys_signame;
216 break;
217 }
218 if (!sig)
219 nosig(*av);
220 } else if (isdigit(**av)) {
220 } else if (isdigit((unsigned char)**av)) {
221 sig = strtol(*av, &ep, 10);
222 if (!*av || *ep)
223 errx(1, "illegal signal number: %s", *av);
224 if (sig < 0 || sig > NSIG)
225 nosig(*av);
226 } else
227 nosig(*av);
228 }

--- 184 unchanged lines hidden ---
221 sig = strtol(*av, &ep, 10);
222 if (!*av || *ep)
223 errx(1, "illegal signal number: %s", *av);
224 if (sig < 0 || sig > NSIG)
225 nosig(*av);
226 } else
227 nosig(*av);
228 }

--- 184 unchanged lines hidden ---