diff options
author | obrien <obrien@FreeBSD.org> | 2000-12-09 09:35:55 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-12-09 09:35:55 +0000 |
commit | c2ee1dcc02035d781d6c70f06df7106979a9f870 (patch) | |
tree | 757810dc1fdd19be4c8125ccb9e8beb1aff3d929 /usr.sbin/watch | |
parent | c174181f432119d1dae3f5e58ecc14c8d7b6f545 (diff) | |
download | FreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.zip FreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.tar.gz |
Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
Diffstat (limited to 'usr.sbin/watch')
-rw-r--r-- | usr.sbin/watch/watch.c | 9 |
1 files changed, 5 insertions, 4 deletions
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 <err.h> #include <locale.h> +#include <paths.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> @@ -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) |