From c2ee1dcc02035d781d6c70f06df7106979a9f870 Mon Sep 17 00:00:00 2001 From: obrien Date: Sat, 9 Dec 2000 09:35:55 +0000 Subject: Add `_PATH_DEVZERO'. Use _PATH_* where where possible. --- usr.sbin/watch/watch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.sbin/watch') diff --git a/usr.sbin/watch/watch.c b/usr.sbin/watch/watch.c index 817f7fc..da80260 100644 --- a/usr.sbin/watch/watch.c +++ b/usr.sbin/watch/watch.c @@ -26,6 +26,7 @@ static const char rcsid[] = #include #include +#include #include #include #include @@ -139,7 +140,7 @@ fatal(err, buf) int open_snp() { - char snp[] = {"/dev/snpX"}; + char snp[] = {_PATH_DEV "snpX"}; char c; int f, mode; @@ -233,14 +234,14 @@ set_dev(name) char buf[DEV_NAME_LEN]; struct stat sb; - if (strlen(name) > 5 && !strncmp(name, "/dev/", 5)) { + if (strlen(name) > 5 && !strncmp(name, _PATH_DEV, sizeof _PATH_DEV - 1)) { snprintf(buf, sizeof buf, "%s", name); } else { if (strlen(name) == 2) - sprintf(buf, "/dev/tty%s", name); + sprintf(buf, "%s%s", _PATH_TTY, name); else - sprintf(buf, "/dev/%s", name); + sprintf(buf, "%s%s", _PATH_DEV, name); } if (*name == '\0' || stat(buf, &sb) < 0) -- cgit v1.1