diff options
author | 2007-02-22 02:26:35 +0000 | |
---|---|---|
committer | 2007-02-22 02:26:35 +0000 | |
commit | 41f684b9434a69d1a4e8a63fad6b3c41bd40b2d6 (patch) | |
tree | 428925b8f44a4df0ba01ce2f6cead611d2196ccf | |
parent | Defer printing of the per-file diff header until after the regexp (diff) | |
download | wireguard-openbsd-41f684b9434a69d1a4e8a63fad6b3c41bd40b2d6.tar.xz wireguard-openbsd-41f684b9434a69d1a4e8a63fad6b3c41bd40b2d6.zip |
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@
-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; |