From 1d9153d7ad8ffa604403790a96d95f625edae799 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 28 Feb 2001 17:50:29 +0000 Subject: [PATCH] Use _PATH_DEV. Reviewed by: grog --- sbin/vinum/commands.c | 5 +++-- sbin/vinum/v.c | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sbin/vinum/commands.c b/sbin/vinum/commands.c index 44a170ab7ea6..2566af290bf0 100644 --- a/sbin/vinum/commands.c +++ b/sbin/vinum/commands.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -544,7 +545,7 @@ vinum_start(int argc, char *argv[], char *arg0[]) if (((stat->device_type & DEVSTAT_TYPE_MASK) == DEVSTAT_TYPE_DIRECT) /* disk device */ &&((stat->device_type & DEVSTAT_TYPE_PASS) == 0) /* and not passthrough */ &&((stat->device_name[0] != '\0'))) { /* and it has a name */ - sprintf(enamelist, "/dev/%s%d", stat->device_name, stat->unit_number); + sprintf(enamelist, "%s%s%d", _PATH_DEV, stat->device_name, stat->unit_number); token[tokens] = enamelist; /* point to it */ tokens++; /* one more token */ enamelist = &enamelist[strlen(enamelist) + 1]; /* and start beyond the end */ @@ -1363,7 +1364,7 @@ vinum_help(int argc, char *argv[], char *argv0[]) "printconfig [file]\n" " Write a copy of the current configuration to file.\n" "makedev\n" - " Remake the device nodes in /dev/vinum.\n" + " Remake the device nodes in " _PATH_DEV "vinum.\n" "move drive [subdisk | plex | drive]\n" " Move the subdisks of the specified object(s) to drive.\n" "quit\n" diff --git a/sbin/vinum/v.c b/sbin/vinum/v.c index 0cda377563f6..27798c36f8ac 100644 --- a/sbin/vinum/v.c +++ b/sbin/vinum/v.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -529,11 +530,11 @@ make_devices(void) else devfs_is_active = 0; - if (!devfs_is_active && access("/dev", W_OK) < 0) { /* can't access /dev to write? */ + if (!devfs_is_active && access(_PATH_DEV, W_OK) < 0) { /* can't access /dev to write? */ if (errno == EROFS) /* because it's read-only, */ - fprintf(stderr, VINUMMOD ": /dev is mounted read-only, not rebuilding " VINUM_DIR "\n"); + fprintf(stderr, VINUMMOD ": %s is mounted read-only, not rebuilding %s\n", _PATH_DEV, VINUM_DIR); else - vinum_perror(VINUMMOD ": Can't write to /dev"); + vinum_perror(VINUMMOD ": Can't write to " _PATH_DEV); return; } if (history) {