summaryrefslogtreecommitdiff
path: root/usr.bin/pkill/pkill.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-09-19 05:52:24 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-09-19 05:52:24 +0000
commit2bcd7d59789e29c0979e4586e27c91231e0d98b0 (patch)
tree5dd2bc9696ae22a3cce9ac3a7b267336caf4f3a2 /usr.bin/pkill/pkill.c
parentbec9fbb71b6b98020d52074619a34722765ce4ac (diff)
Use S_IS* macros insted of masking with S_IF* flags. The latter may
have multiple bits set, which lead to surprising results. Spotted by Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@
Diffstat (limited to 'usr.bin/pkill/pkill.c')
-rw-r--r--usr.bin/pkill/pkill.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index 4e82a73a6ed..02848d7b64f 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkill.c,v 1.14 2005/07/16 11:48:46 jmc Exp $ */
+/* $OpenBSD: pkill.c,v 1.15 2006/09/19 05:52:23 otto Exp $ */
/* $NetBSD: pkill.c,v 1.5 2002/10/27 11:49:34 kleink Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: pkill.c,v 1.14 2005/07/16 11:48:46 jmc Exp $";
+static const char rcsid[] = "$OpenBSD: pkill.c,v 1.15 2006/09/19 05:52:23 otto Exp $";
#endif /* !lint */
#include <sys/types.h>
@@ -537,7 +537,7 @@ makelist(struct listhead *head, enum listtype type, char *src)
err(STATUS_ERROR, "stat(%s)", sp);
}
- if ((st.st_mode & S_IFCHR) == 0)
+ if (!S_ISCHR(st.st_mode))
errx(STATUS_BADUSAGE, "not a tty: `%s'", sp);
li->li_number = st.st_rdev;