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/v.c | |
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/v.c')
-rw-r--r-- | sbin/vinum/v.c | 8 |
1 files changed, 5 insertions, 3 deletions
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; |