summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-12-09 09:35:55 +0000
committerobrien <obrien@FreeBSD.org>2000-12-09 09:35:55 +0000
commitc2ee1dcc02035d781d6c70f06df7106979a9f870 (patch)
tree757810dc1fdd19be4c8125ccb9e8beb1aff3d929 /share
parentc174181f432119d1dae3f5e58ecc14c8d7b6f545 (diff)
downloadFreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.zip
FreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.tar.gz
Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
Diffstat (limited to 'share')
-rw-r--r--share/examples/kld/cdev/test/testcdev.c4
-rw-r--r--share/examples/scsi_target/scsi_target.c2
-rw-r--r--share/examples/sunrpc/msg/msg_proc.c4
-rw-r--r--share/examples/sunrpc/msg/printmsg.c4
4 files changed, 10 insertions, 4 deletions
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 <stdio.h>
#include <fcntl.h>
+#include <paths.h>
#include <string.h>
#include <sys/ioccom.h>
@@ -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 <paths.h>
#include <stdio.h>
#include <rpc/rpc.h> /* 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 <paths.h>
#include <stdio.h>
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);
}
OpenPOWER on IntegriCloud