summaryrefslogtreecommitdiffstats
path: root/sbin/disklabel/editor.c
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2009-04-18 00:15:46 +0000
committersthen <sthen@openbsd.org>2009-04-18 00:15:46 +0000
commit0c30c0ae0394a49b41248018018f5a59d9c3d2d3 (patch)
tree57eaa32979e4e9052bcdf8288a2f0f94a13e1be2 /sbin/disklabel/editor.c
parentcorrecto in comment; from Amarendra Godbole (diff)
downloadwireguard-openbsd-0c30c0ae0394a49b41248018018f5a59d9c3d2d3.tar.xz
wireguard-openbsd-0c30c0ae0394a49b41248018018f5a59d9c3d2d3.zip
Alexander Hall points out that disklabel -AE <disk> followed by quitting
without making manual changes does not ask whether you'd like to save the new automatic disklabel. Change to follow the behaviour of -d and ask every time. ok krw@.
Diffstat (limited to 'sbin/disklabel/editor.c')
-rw-r--r--sbin/disklabel/editor.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 1b40da801f9..612c4f35a7d 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.191 2009/04/12 01:01:24 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.192 2009/04/18 00:15:46 sthen 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.191 2009/04/12 01:01:24 krw Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.192 2009/04/18 00:15:46 sthen Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -317,7 +317,8 @@ editor(struct disklabel *lp, int f)
* didn't change the label read from disk, there is no
* need to do anything before exiting.
*/
- if (!dflag && memcmp(lp, &label, sizeof(label)) == 0) {
+ if (!aflag && !dflag &&
+ memcmp(lp, &label, sizeof(label)) == 0) {
puts("No label changes.");
return(1);
}