diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-06-04 18:34:42 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-06-04 18:34:42 +0000 |
commit | c9bce2fb7677033074cc66af2d62942434193dd0 (patch) | |
tree | 5bb2a305b02c5e6ef53c049688212fbce2fbd077 | |
parent | 4f0bf7efbcc94139ce9e49e977c9841a5b5e6792 (diff) |
Don't exit just because we couldn't get the default label...
-rw-r--r-- | sbin/disklabel/editor.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 67b9cba14b6..7e1a15e4bb4 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.71 2000/06/04 18:19:45 millert Exp $ */ +/* $OpenBSD: editor.c,v 1.72 2000/06/04 18:34:41 millert Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -28,7 +28,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.71 2000/06/04 18:19:45 millert Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.72 2000/06/04 18:34:41 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -253,12 +253,14 @@ editor(lp, f, dev, fstabfile) break; case 'D': - tmplabel = label; - label = lastlabel; - lastlabel = tmplabel; - if (ioctl(f, DIOCGPDINFO, &label) < 0) - err(4, "ioctl DIOCGDINFO"); - editor_countfree(&label, &freesectors); + tmplabel = lastlabel; + lastlabel = label; + if (ioctl(f, DIOCGPDINFO, &label) == 0) + editor_countfree(&label, &freesectors); + else { + warn("unable to get default partition table"); + lastlabel = tmplabel; + } break; case 'd': @@ -436,9 +438,8 @@ editor(lp, f, dev, fstabfile) break; case 'z': - tmplabel = label; - label = lastlabel; - lastlabel = tmplabel; + tmplabel = lastlabel; + lastlabel = label; zero_partitions(&label, &freesectors); break; |