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.bin/doscmd | |
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.bin/doscmd')
-rw-r--r-- | usr.bin/doscmd/dos.c | 5 | ||||
-rw-r--r-- | usr.bin/doscmd/doscmd.c | 3 | ||||
-rw-r--r-- | usr.bin/doscmd/int17.c | 3 | ||||
-rw-r--r-- | usr.bin/doscmd/tty.c | 7 |
4 files changed, 11 insertions, 7 deletions
diff --git a/usr.bin/doscmd/dos.c b/usr.bin/doscmd/dos.c index 0a896b1..67b43687 100644 --- a/usr.bin/doscmd/dos.c +++ b/usr.bin/doscmd/dos.c @@ -44,6 +44,7 @@ #include <glob.h> #include <errno.h> #include <ctype.h> +#include <paths.h> #include <stddef.h> #include "dispatch.h" @@ -273,7 +274,7 @@ translate_filename(u_char *dname, u_char *uname, int *drivep) if (!strcasecmp(dname, "con")) { *drivep = -1; - strcpy(uname, "/dev/tty"); + strcpy(uname, _PATH_TTY); return (0); } @@ -281,7 +282,7 @@ translate_filename(u_char *dname, u_char *uname, int *drivep) /* Really need a better way to handle devices */ if (!strcasecmp(dname, "emmxxxx0")) { *drivep = -1; - strcpy(uname, "/dev/null"); + strcpy(uname, _PATH_DEVNULL); return (0); } diff --git a/usr.bin/doscmd/doscmd.c b/usr.bin/doscmd/doscmd.c index 8b6727b..7463af6 100644 --- a/usr.bin/doscmd/doscmd.c +++ b/usr.bin/doscmd/doscmd.c @@ -39,6 +39,7 @@ #include <errno.h> #include <limits.h> +#include <paths.h> #include <pwd.h> #include <signal.h> #include <unistd.h> @@ -116,7 +117,7 @@ main(int argc, char **argv) /* XXX should only be for tty mode */ - fd = open ("/dev/null", O_RDWR); + fd = open (_PATH_DEVNULL, O_RDWR); if (fd != 3) dup2 (fd, 3); /* stdaux */ if (fd != 4) diff --git a/usr.bin/doscmd/int17.c b/usr.bin/doscmd/int17.c index d62d6da..0cb162b 100644 --- a/usr.bin/doscmd/int17.c +++ b/usr.bin/doscmd/int17.c @@ -33,6 +33,7 @@ */ #include "doscmd.h" +#include <paths.h> #include <signal.h> static int lpt_fd[4] = { -1, -1, -1, -1, }; @@ -138,7 +139,7 @@ open_printer(int printer) return; } } else { - sprintf(printer_name, "/dev/lpt%d", printer); + sprintf(printer_name, "%slpt%d", _PATH_DEV, printer); debug(D_PRINTER, "Opening device %s\n", printer_name); if ((fd = open(printer_name, O_WRONLY)) < 0) { perror(printer_name); diff --git a/usr.bin/doscmd/tty.c b/usr.bin/doscmd/tty.c index 389695c..a078812 100644 --- a/usr.bin/doscmd/tty.c +++ b/usr.bin/doscmd/tty.c @@ -44,6 +44,7 @@ #include <unistd.h> #include <sys/ioctl.h> #include <fcntl.h> +#include <paths.h> #include <signal.h> #include <sys/time.h> #ifdef __FreeBSD__ @@ -306,8 +307,8 @@ console_init() } #endif - if ((fd = open("/dev/console", 2)) < 0) { - perror("/dev/console"); + if ((fd = open(_PATH_CONSOLE, 2)) < 0) { + perror(_PATH_CONSOLE); quit(1); } @@ -2036,7 +2037,7 @@ video_init() i = 0; if (fds) for (i = 0; i < nfds && (i == 0 || fds[i-1] < 63); ++i) - if ((fds[i] = open("/dev/null", 0)) < 0) + if ((fds[i] = open(_PATH_DEVNULL, 0)) < 0) break; /* * Leave 3 fds behind for X to play with |