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. --- share/examples/kld/cdev/test/testcdev.c | 4 +++- share/examples/scsi_target/scsi_target.c | 2 +- share/examples/sunrpc/msg/msg_proc.c | 4 +++- share/examples/sunrpc/msg/printmsg.c | 4 +++- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'share') diff --git a/share/examples/kld/cdev/test/testcdev.c b/share/examples/kld/cdev/test/testcdev.c index 8f2c0b3..d69c3f5 100644 --- a/share/examples/kld/cdev/test/testcdev.c +++ b/share/examples/kld/cdev/test/testcdev.c @@ -70,8 +70,10 @@ * * $FreeBSD$ */ + #include #include +#include #include #include @@ -97,7 +99,7 @@ main(int argc, char *argv[]) if (ioctl(kernel_fd, CDEV_IOCTL1, &one) == -1) { perror("CDEV_IOCTL1"); } else { - printf( "Sent ioctl CDEV_IOCTL1 to device /dev/" CDEV_DEVICE "\n"); + printf( "Sent ioctl CDEV_IOCTL1 to device %s%s\n", _PATH_DEV, CDEV_DEVICE); } len = strlen(writestr) + 1; diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c index c240686..6439d44 100644 --- a/share/examples/scsi_target/scsi_target.c +++ b/share/examples/scsi_target/scsi_target.c @@ -138,7 +138,7 @@ main(int argc, char *argv[]) exit(EX_SOFTWARE); } - snprintf(targdevname, sizeof(targdevname), "/dev/targ%d", + snprintf(targdevname, sizeof(targdevname), "%starg%d", _PATH_DEV, alloc_unit.unit); if ((targfd = open(targdevname, O_RDWR)) == -1) { diff --git a/share/examples/sunrpc/msg/msg_proc.c b/share/examples/sunrpc/msg/msg_proc.c index 96c1cb5..ed08883 100644 --- a/share/examples/sunrpc/msg/msg_proc.c +++ b/share/examples/sunrpc/msg/msg_proc.c @@ -1,7 +1,9 @@ /* @(#)msg_proc.c 2.1 88/08/11 4.0 RPCSRC */ +/* $FreeBSD$ */ /* * msg_proc.c: implementation of the remote procedure "printmessage" */ +#include #include #include /* always need this here */ #include "msg.h" /* need this too: msg.h will be generated by rpcgen */ @@ -16,7 +18,7 @@ printmessage_1(msg) static int result; /* must be static! */ FILE *f; - f = fopen("/dev/console", "w"); + f = fopen(_PATH_CONSOLE, "w"); if (f == NULL) { result = 0; return (&result); diff --git a/share/examples/sunrpc/msg/printmsg.c b/share/examples/sunrpc/msg/printmsg.c index f2d5285..681007c 100644 --- a/share/examples/sunrpc/msg/printmsg.c +++ b/share/examples/sunrpc/msg/printmsg.c @@ -1,7 +1,9 @@ /* @(#)printmsg.c 2.1 88/08/11 4.0 RPCSRC */ +/* $FreeBSD$ */ /* * printmsg.c: print a message on the console */ +#include #include main(argc, argv) @@ -33,7 +35,7 @@ printmessage(msg) { FILE *f; - f = fopen("/dev/console", "w"); + f = fopen(_PATH_CONSOLE, "w"); if (f == NULL) { return (0); } -- cgit v1.1