diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-05-17 01:17:13 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-05-17 01:17:13 +0000 |
commit | 28ee436a0950562d11703c73e89ae9b87e42f932 (patch) | |
tree | 6824ef7a6f801e870c3abc2ac7d5cc97620b7aa4 /sbin | |
parent | 43b3502499f593d85fcabe98e9c4ac1038ed2614 (diff) |
Write out mountpoint info in writelabel() after label successfully
written, rather than every time editor_alloc() is called. Respect
'-n' for mountpoint info. Reduces surprise appearance of files when
you 'x' out of Editor.
"my sunglasses did not go dark" deraadt@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/disklabel/disklabel.c | 8 | ||||
-rw-r--r-- | sbin/disklabel/editor.c | 6 |
2 files changed, 8 insertions, 6 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 0fb27fa4803..0b2854472b7 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.c,v 1.153 2009/05/05 12:24:19 otto Exp $ */ +/* $OpenBSD: disklabel.c,v 1.154 2009/05/17 01:17:12 krw Exp $ */ /* * Copyright (c) 1987, 1993 @@ -39,7 +39,7 @@ static const char copyright[] = #endif /* not lint */ #ifndef lint -static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.153 2009/05/05 12:24:19 otto Exp $"; +static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.154 2009/05/17 01:17:12 krw Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -508,6 +508,10 @@ writelabel(int f, char *boot, struct disklabel *lp) } } #endif + /* Finally, write out any mount point information. */ + if (!donothing) + mpsave(lp); + return (0); } diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c index 3093058a0c1..cba414f145c 100644 --- a/sbin/disklabel/editor.c +++ b/sbin/disklabel/editor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: editor.c,v 1.210 2009/05/17 01:06:56 krw Exp $ */ +/* $OpenBSD: editor.c,v 1.211 2009/05/17 01:17:12 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.210 2009/05/17 01:06:56 krw Exp $"; +static char rcsid[] = "$OpenBSD: editor.c,v 1.211 2009/05/17 01:17:12 krw Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -657,8 +657,6 @@ cylinderalign: free(alloc); memcpy(lp_org, lp, sizeof(struct disklabel)); - /* Save mountpoint info if there is any. */ - mpsave(lp); } /* |