Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/disklabel If checklabel() failed, the label has not bee...



details:   https://anonhg.NetBSD.org/src/rev/864706f22a86
branches:  trunk
changeset: 471723:864706f22a86
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Apr 09 10:06:18 1999 +0000

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

diffstat:

 sbin/disklabel/disklabel.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 6c48f50b204a -r 864706f22a86 sbin/disklabel/disklabel.c
--- a/sbin/disklabel/disklabel.c        Fri Apr 09 09:34:13 1999 +0000
+++ b/sbin/disklabel/disklabel.c        Fri Apr 09 10:06:18 1999 +0000
@@ -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
@@ -47,7 +47,7 @@
 static char sccsid[] = "@(#)disklabel.c        8.4 (Berkeley) 5/4/95";
 /* from static char sccsid[] = "@(#)disklabel.c        1.2 (Symmetric) 11/28/85"; */
 #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 /* not lint */
 
@@ -353,6 +353,8 @@
                *lp = lab;
                if (checklabel(lp) == 0)
                        error = writelabel(f, bootarea, lp);
+               else
+                       error = 1;
                break;
 
        case WRITEBOOT:
@@ -368,13 +370,15 @@
                *lp = tlab;
                if (checklabel(lp) == 0)
                        error = writelabel(f, bootarea, lp);
+               else
+                       error = 1;
                break;
        }
 #endif
        case UNSPEC:
                usage();
        }
-       return error;
+       exit(error);
 }
 
 /*



Home | Main Index | Thread Index | Old Index