diff options
author | grog <grog@FreeBSD.org> | 1999-04-09 01:14:36 +0000 |
---|---|---|
committer | grog <grog@FreeBSD.org> | 1999-04-09 01:14:36 +0000 |
commit | b8d0fb1938c6ea47802e8cb6b72dd83217706ee2 (patch) | |
tree | 5971068cee9fca5f4da1ec322c41f1af83c8f550 /sbin/vinum | |
parent | e595dd9e791a7eb6b5a7fe22be06e31e5865a8a5 (diff) | |
download | FreeBSD-src-b8d0fb1938c6ea47802e8cb6b72dd83217706ee2.zip FreeBSD-src-b8d0fb1938c6ea47802e8cb6b72dd83217706ee2.tar.gz |
If the wrong version of vinum(8) has been started (i.e. non-RAID-5
when the kernel module is RAID-5, or the other way round), execve()
the correct one.
Add \n to an error message.
Diffstat (limited to 'sbin/vinum')
-rw-r--r-- | sbin/vinum/Makefile | 2 | ||||
-rw-r--r-- | sbin/vinum/v.c | 8 | ||||
-rw-r--r-- | sbin/vinum/vext.h | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sbin/vinum/Makefile b/sbin/vinum/Makefile index 5ea95f2..6462fcd 100644 --- a/sbin/vinum/Makefile +++ b/sbin/vinum/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 1999/01/13 23:05:26 grog Exp $ +# $Id: Makefile.sbin,v 1.3 1999/02/11 05:09:49 grog Exp grog $ MAINTAINER = grog@FreeBSD.org PROG= vinum diff --git a/sbin/vinum/v.c b/sbin/vinum/v.c index 772d431..7dfd8dd 100644 --- a/sbin/vinum/v.c +++ b/sbin/vinum/v.c @@ -116,11 +116,13 @@ char *token[MAXARGS]; /* pointers to individual tokens */ int tokens; /* number of tokens */ int -main(int argc, char *argv[]) +main(int argc, char *argv[], char *envp[]) { #if __FreeBSD__ >= 3 if (modfind(WRONGMOD) >= 0) { /* wrong module loaded, */ - fprintf(stderr, "Wrong module loaded: %s. Please start %s.\n", VINUMMOD, WRONGMOD); + fprintf(stderr, "Wrong module loaded: %s. Starting %s.\n", VINUMMOD, WRONGMOD); + argv[0] = "/sbin/" WRONGMOD; + execve(argv[0], argv, envp); exit(1); } if (modfind(VINUMMOD) < 0) { @@ -406,7 +408,7 @@ make_devices(void) if (access("/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); + fprintf(stderr, VINUMMOD ": /dev is mounted read-only, not rebuilding " VINUM_DIR "\n"); else perror(VINUMMOD ": Can't write to /dev"); return; diff --git a/sbin/vinum/vext.h b/sbin/vinum/vext.h index f58df491..0fd6c46 100644 --- a/sbin/vinum/vext.h +++ b/sbin/vinum/vext.h @@ -35,7 +35,7 @@ * */ -/* $Id: vext.h,v 1.3 1999/01/21 00:45:11 grog Exp $ */ +/* $Id: vext.h,v 1.11 1999/03/02 04:10:00 grog Exp grog $ */ #define MAXARGS 64 /* maximum number of args on a line */ #define PLEXINITSIZE 61440 /* this is what the system does somewhere */ |