diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-10-02 00:51:59 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-10-02 00:51:59 +0000 |
commit | 872eb732c0441051dd56f698cc2e6d7287b2e6c9 (patch) | |
tree | 55f47f3e1efc9f1eff5b531bfd120e16cb6f6f63 /sbin/disklabel | |
parent | bfb58197f6071d88695e63426c8c516a8ff60512 (diff) |
Add 'w' (write label) command.
Diffstat (limited to 'sbin/disklabel')
-rw-r--r-- | sbin/disklabel/editor.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 5e10dba0cc6..ff8c2dbd8c9 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.2 1997/10/02 00:02:55 millert Exp $ */ +/* $OpenBSD: editor.c,v 1.3 1997/10/02 00:51:58 millert Exp $ */ /* * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> @@ -31,7 +31,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.2 1997/10/02 00:02:55 millert Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.3 1997/10/02 00:51:58 millert Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -128,6 +128,7 @@ editor(lp, f) puts("\tm [part] - modify existing partition."); puts("\tu - undo last change."); puts("\ts [path] - save label to file."); + puts("\tw - write label to disk."); puts("\tq - quit and save changes."); puts("\tx - exit without saving changes."); puts("\t? - this message.\n"); @@ -220,6 +221,15 @@ editor(lp, f) } break; + case 'w': + if (donothing) + puts("In no change mode, not writing label."); + else if (memcmp(lp, &label, sizeof(label)) == 0) + puts("No changes."); + else if (writelabel(f, bootarea, &label) != 0) + warnx("unable to write label"); + break; + case 'x': return(1); break; |