svn commit: trunk/busybox/modutils

landley at busybox.net landley at busybox.net
Thu Dec 15 07:42:15 UTC 2005


Author: landley
Date: 2005-12-14 23:42:13 -0800 (Wed, 14 Dec 2005)
New Revision: 12892

Log:
Better use of the ENABLE guards.


Modified:
   trunk/busybox/modutils/modprobe.c


Changeset:
Modified: trunk/busybox/modutils/modprobe.c
===================================================================
--- trunk/busybox/modutils/modprobe.c	2005-12-15 07:25:54 UTC (rev 12891)
+++ trunk/busybox/modutils/modprobe.c	2005-12-15 07:42:13 UTC (rev 12892)
@@ -238,6 +238,8 @@
 	*dst = xrealloc( *dst, strlen( *dst ) );
 	return src;
 }
+#else
+#define parse_command_string(src, dst)	(0)
 #endif /* ENABLE_FEATURE_MODPROBE_MULTIPLE_OPTIONS */
 
 /*
@@ -428,9 +430,8 @@
 
 	// alias parsing is not 100% correct (no correct handling of continuation lines within an alias) !
 
-#if ENABLE_FEATURE_2_6_MODULES
-	if (( fd = open ( "/etc/modprobe.conf", O_RDONLY )) < 0 )
-#endif
+	if (!ENABLE_FEATURE_2_6_MODULES
+			|| ( fd = open ( "/etc/modprobe.conf", O_RDONLY )) < 0 )
 		if (( fd = open ( "/etc/modules.conf", O_RDONLY )) < 0 )
 			if (( fd = open ( "/etc/conf.modules", O_RDONLY )) < 0 )
 				return first;
@@ -496,15 +497,13 @@
 						if ( strcmp ( dt-> m_name, mod ) == 0 )
 							break;
 					}
-					if ( dt ) {
-#if ENABLE_FEATURE_MODPROBE_MULTIPLE_OPTIONS
+					if ( ENABLE_FEATURE_MODPROBE_MULTIPLE_OPTIONS && dt ) {
 						char* new_opt = NULL;
 						while( ( opt = parse_command_string( opt, &new_opt ) ) ) {
 							dt-> m_options = append_option( dt-> m_options, new_opt );
 						}
-#else
+					} else {
 						dt-> m_options = append_option( dt-> m_options, opt );
-#endif
 					}
 				}
 			}




More information about the busybox-cvs mailing list