diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-02-22 02:26:36 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-02-22 02:26:36 +0000 |
commit | b3df706149992501b4ead2b3d412ed77f2c37518 (patch) | |
tree | e37a43b67c5155186bd5cb31e049d0fa6e1d5917 /sbin | |
parent | be149d36c9ca2560b190f1fc6b126d4ca98ed846 (diff) |
Always write the disklabel to disk when asked, even if it appears to
be unchanged. Fixes PR#5209. Proper behaviour of 'q'uit still under
discussion.
ok ray@ millert@ ckuethe@ nick@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/disklabel/editor.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index e63d8f038b9..aa5d0edc6eb 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.105 2006/10/14 18:26:55 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.106 2007/02/22 02:26:35 krw Exp $ */ /* * Copyright (c) 1997-2000 Todd C. Miller <Todd.Miller@courtesan.com> @@ -17,7 +17,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: editor.c,v 1.105 2006/10/14 18:26:55 krw Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.106 2007/02/22 02:26:35 krw Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -389,10 +389,8 @@ editor(struct disklabel *lp, int f, char *dev, char *fstabfile) /* Save mountpoint info if there is any. */ if (mountpoints != NULL) mpsave(&label, mountpoints, dev, fstabfile); - /* Save label if it has changed. */ - if (memcmp(lp, &label, sizeof(label)) == 0) - puts("No label changes."); - else if (writelabel(f, bootarea, &label) != 0) + /* Write label to disk. */ + if (writelabel(f, bootarea, &label) != 0) warnx("unable to write label"); else *lp = label; |