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.
This commit is contained in:
Greg Lehey 1999-04-09 01:14:36 +00:00
parent d5b537d01a
commit 033916740b
3 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 */