If checklabel() failed, the label has not been written, so exit(1).

This commit is contained in:
bouyer 1999-04-09 10:06:18 +00:00
parent 04ef8b5750
commit 3cf54e49e9
1 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: disklabel.c,v 1.64 1999/04/05 02:50:52 cgd Exp $ */ /* $NetBSD: disklabel.c,v 1.65 1999/04/09 10:06:18 bouyer Exp $ */
/* /*
* Copyright (c) 1987, 1993 * Copyright (c) 1987, 1993
@ -47,7 +47,7 @@ __COPYRIGHT("@(#) Copyright (c) 1987, 1993\n\
static char sccsid[] = "@(#)disklabel.c 8.4 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)disklabel.c 8.4 (Berkeley) 5/4/95";
/* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */ /* from static char sccsid[] = "@(#)disklabel.c 1.2 (Symmetric) 11/28/85"; */
#else #else
__RCSID("$NetBSD: disklabel.c,v 1.64 1999/04/05 02:50:52 cgd Exp $"); __RCSID("$NetBSD: disklabel.c,v 1.65 1999/04/09 10:06:18 bouyer Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -353,6 +353,8 @@ main(argc, argv)
*lp = lab; *lp = lab;
if (checklabel(lp) == 0) if (checklabel(lp) == 0)
error = writelabel(f, bootarea, lp); error = writelabel(f, bootarea, lp);
else
error = 1;
break; break;
case WRITEBOOT: case WRITEBOOT:
@ -368,13 +370,15 @@ main(argc, argv)
*lp = tlab; *lp = tlab;
if (checklabel(lp) == 0) if (checklabel(lp) == 0)
error = writelabel(f, bootarea, lp); error = writelabel(f, bootarea, lp);
else
error = 1;
break; break;
} }
#endif #endif
case UNSPEC: case UNSPEC:
usage(); usage();
} }
return error; exit(error);
} }
/* /*