Module Name:    src
Committed By:   christos
Date:           Wed Jan 23 21:42:23 UTC 2013

Modified Files:
        src/usr.sbin/makefs: ffs.c makefs.c msdos.c

Log Message:
return the bit of the option set, so that others can act on it.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makefs/makefs.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/makefs/msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.51 src/usr.sbin/makefs/ffs.c:1.52
--- src/usr.sbin/makefs/ffs.c:1.51	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/ffs.c	Wed Jan 23 16:42:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.51 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: ffs.c,v 1.52 2013/01/23 21:42:22 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.51 2013/01/23 21:32:32 christos Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.52 2013/01/23 21:42:22 christos Exp $");
 #endif	/* !__lint */
 
 #include <sys/param.h>
@@ -232,6 +232,9 @@ ffs_parse_opts(const char *option, fsinf
 	for (i = 0; ffs_options[i].name && (1 << i) != rv; i++)
 		continue;
 
+	if (ffs_options[i].name == NULL)
+		abort();
+
 	if (strcmp(ffs_options[i].name, "optimization") == 0) {
 		if (strcmp(optimization, "time") == 0) {
 			ffs_opts->optimization = FS_OPTTIME;

Index: src/usr.sbin/makefs/makefs.c
diff -u src/usr.sbin/makefs/makefs.c:1.37 src/usr.sbin/makefs/makefs.c:1.38
--- src/usr.sbin/makefs/makefs.c:1.37	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/makefs.c	Wed Jan 23 16:42:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: makefs.c,v 1.37 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: makefs.c,v 1.38 2013/01/23 21:42:22 christos Exp $	*/
 
 /*
  * Copyright (c) 2001-2003 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: makefs.c,v 1.37 2013/01/23 21:32:32 christos Exp $");
+__RCSID("$NetBSD: makefs.c,v 1.38 2013/01/23 21:42:22 christos Exp $");
 #endif	/* !__lint */
 
 #include <assert.h>
@@ -367,7 +367,7 @@ set_option_var(const option_t *options, 
 			    val);
 			return 0;
 		}
-		return 1;
+		return 1 << i;
 	}
 	warnx("Unknown option `%s'", var);
 	return (0);

Index: src/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.2 src/usr.sbin/makefs/msdos.c:1.3
--- src/usr.sbin/makefs/msdos.c:1.2	Wed Jan 23 16:32:32 2013
+++ src/usr.sbin/makefs/msdos.c	Wed Jan 23 16:42:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.2 2013/01/23 21:32:32 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.3 2013/01/23 21:42:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: msdos.c,v 1.2 2013/01/23 21:32:32 christos Exp $");
+__RCSID("$NetBSD: msdos.c,v 1.3 2013/01/23 21:42:22 christos Exp $");
 #endif	/* !__lint */
 
 #include <sys/param.h>
@@ -101,6 +101,7 @@ ALLOPTS
 #undef AOPT	
 		{ .name = NULL }
 	};
+	int i, rv;
 
 	assert(option != NULL);
 	assert(fsopts != NULL);
@@ -109,7 +110,22 @@ ALLOPTS
 	if (debug & DEBUG_FS_PARSE_OPTS)
 		printf("msdos_parse_opts: got `%s'\n", option);
 
-	return set_option(msdos_options, option);
+	rv = set_option(msdos_options, option);
+	if (rv == 0)
+		return rv;
+
+	for (i = 0; msdos_options[i].name != NULL && (1 << i) != rv; i++)
+		break;
+	if (msdos_options[i].name == NULL)
+		abort();
+
+	if (strcmp(msdos_options[i].name, "volume_id") == 0)
+		msdos_opt->volume_id_set = 1;
+	else if (strcmp(msdos_options[i].name, "media_descriptor") == 0)
+		msdos_opt->media_descriptor_set = 1;
+	else if (strcmp(msdos_options[i].name, "hidden_sectors") == 0)
+		msdos_opt->hidden_sectors_set = 1;
+	return rv;
 }
 
 

Reply via email to