summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-11 23:09:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-11 23:09:29 +0000
commit5e3f58b14cd4dc626ab1335eac511e0e235b7b63 (patch)
tree5de86ac63aae7eac00df9c464afebc34b544aa37 /sbin
parent49419e5a4ffaea93089bdc323cee41b2aaa410d4 (diff)
Always save an fstab file, even if it is empty; ok krw
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/editor.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 4704e126782..0917fc3de2e 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.203 2009/05/03 22:01:46 krw Exp $ */
+/* $OpenBSD: editor.c,v 1.204 2009/05/11 23:09:28 deraadt 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.203 2009/05/03 22:01:46 krw Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.204 2009/05/11 23:09:28 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -1860,23 +1860,19 @@ mpequal(char **mp1, char **mp2)
int
mpsave(struct disklabel *lp)
{
- int i, j, mpset;
+ int i, j;
char bdev[MAXPATHLEN], *p;
struct mountinfo mi[MAXPARTITIONS];
FILE *fp;
memset(&mi, 0, sizeof(mi));
- for (i = 0, mpset = 0; i < MAXPARTITIONS; i++) {
+ for (i = 0; i < MAXPARTITIONS; i++) {
if (mountpoints[i] != NULL) {
mi[i].mountpoint = mountpoints[i];
mi[i].partno = i;
- mpset = 1;
}
}
- /* Exit if there is nothing to do... */
- if (!mpset)
- return(0);
/* Convert specname to bdev */
if (strncmp(_PATH_DEV, specname, sizeof(_PATH_DEV) - 1) == 0 &&