svn commit: trunk/busybox: e2fsprogs include libbb

vodz at busybox.net vodz at busybox.net
Sat Nov 26 10:34:03 UTC 2005


Author: vodz
Date: 2005-11-26 02:33:55 -0800 (Sat, 26 Nov 2005)
New Revision: 12534

Log:
more use const for interface of libbb/compare_string_array, example usage for e2fsprogs/fsck

Modified:
   trunk/busybox/e2fsprogs/fsck.c
   trunk/busybox/include/libbb.h
   trunk/busybox/libbb/compare_string_array.c


Changeset:
Modified: trunk/busybox/e2fsprogs/fsck.c
===================================================================
--- trunk/busybox/e2fsprogs/fsck.c	2005-11-26 01:14:13 UTC (rev 12533)
+++ trunk/busybox/e2fsprogs/fsck.c	2005-11-26 10:33:55 UTC (rev 12534)
@@ -988,8 +988,7 @@
 /* Check if we should ignore this filesystem. */
 static int ignore(struct fs_info *fs)
 {
-	const char * const *ip;
-	int wanted = 0;
+	int wanted;
 	char *s;
 
 	/*
@@ -1007,15 +1006,11 @@
 	if (!fs_match(fs, &fs_type_compiled)) return 1;
 
 	/* Are we ignoring this type? */
-	for(ip = ignored_types; *ip; ip++)
-		if (strcmp(fs->type, *ip) == 0) return 1;
+	if(compare_string_array(ignored_types, fs->type))
+		return 1;
 
 	/* Do we really really want to check this fs? */
-	for(ip = really_wanted; *ip; ip++)
-		if (strcmp(fs->type, *ip) == 0) {
-			wanted = 1;
-			break;
-		}
+	wanted = compare_string_array(really_wanted, fs->type);
 
 	/* See if the <fsck.fs> program is available. */
 	s = find_fsck(fs->type);

Modified: trunk/busybox/include/libbb.h
===================================================================
--- trunk/busybox/include/libbb.h	2005-11-26 01:14:13 UTC (rev 12533)
+++ trunk/busybox/include/libbb.h	2005-11-26 10:33:55 UTC (rev 12534)
@@ -466,7 +466,7 @@
 } procps_status_t;
 
 extern procps_status_t * procps_scan(int save_user_arg0);
-extern unsigned short compare_string_array(const char *string_array[], const char *key);
+extern unsigned short compare_string_array(const char * const string_array[], const char *key);
 
 extern int my_query_module(const char *name, int which, void **buf, size_t *bufsize, size_t *ret);
 

Modified: trunk/busybox/libbb/compare_string_array.c
===================================================================
--- trunk/busybox/libbb/compare_string_array.c	2005-11-26 01:14:13 UTC (rev 12533)
+++ trunk/busybox/libbb/compare_string_array.c	2005-11-26 10:33:55 UTC (rev 12534)
@@ -17,7 +17,8 @@
 #include <string.h>
 
 /* returns the array number of the string */
-extern unsigned short compare_string_array(const char *string_array[], const char *key)
+extern unsigned short 
+compare_string_array(const char * const string_array[], const char *key)
 {
 	unsigned short i;
 




More information about the busybox-cvs mailing list