X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=modutils%2Fmodprobe.c;h=844eb99c5ee3d36a95b3939ca9158fa62a2b4697;hb=3496fdc9a573a424e34141cbe04250cc8df15e32;hp=31fc9baf269a620df50e828be9bc8fe618373768;hpb=3858bf18d5d3b6a858ca46acb6c8628715520d1c;p=oweals%2Fbusybox.git diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 31fc9baf2..844eb99c5 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -5,7 +5,7 @@ * Copyright (c) 2002 by Robert Griebl, griebl@gmx.de * Copyright (c) 2003 by Andrew Dennison, andrew.dennison@motec.com.au * Copyright (c) 2005 by Jim Bauer, jfbauer@nfr.com - * + * * Portions Copyright (c) 2005 by Yann E. MORIN, yann.morin.1998@anciens.enib.fr * * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. @@ -33,7 +33,7 @@ struct dep_t { /* one-way list of dependency rules */ char * m_name; /* the module name*/ char * m_path; /* the module file path */ struct mod_opt_t * m_options; /* the module options */ - + int m_isalias : 1; /* the module is an alias */ int m_reserved : 15; /* stuffin' */ @@ -130,7 +130,7 @@ struct mod_opt_t *append_option( struct mod_opt_t *opt_list, char *opt ) return opt_list; } -#if (defined CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS) +#if ENABLE_FEATURE_MODPROBE_MULTIPLE_OPTIONS /* static char* parse_command_string( char* src, char **dst ); * src: pointer to string containing argument * dst: pointer to where to store the parsed argument @@ -238,7 +238,9 @@ static char *parse_command_string( char *src, char **dst ) *dst = xrealloc( *dst, strlen( *dst ) ); return src; } -#endif /* CONFIG_FEATURE_MODPROBE_MULTIPLE_OPTIONS */ +#else +#define parse_command_string(src, dst) (0) +#endif /* ENABLE_FEATURE_MODPROBE_MULTIPLE_OPTIONS */ /* * This function builds a list of dependency rules from /lib/modules/`uname -r\modules.dep. @@ -296,7 +298,7 @@ static struct dep_t *build_dep ( void ) /* Is this a new module dep description? */ if ( !continuation_line ) { - /* find the dep begining */ + /* find the dep beginning */ char *col = strchr ( buffer, ':' ); char *dot = col; @@ -382,7 +384,7 @@ static struct dep_t *build_dep ( void ) else next = end; - /* find the begining of the module file name */ + /* find the beginning of the module file name */ deps = strrchr ( p, '/' ); if ( !deps || ( deps < p )) { @@ -428,9 +430,8 @@ static struct dep_t *build_dep ( void ) // alias parsing is not 100% correct (no correct handling of continuation lines within an alias) ! -#if defined(CONFIG_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; @@ -711,7 +712,7 @@ static void check_dep ( char *mod, struct mod_list_t **head, struct mod_list_t * mod = dt-> m_name; path = dt-> m_path; opt = dt-> m_options; - + // search for duplicates for ( find = *head; find; find = find-> m_next ) { if ( !strcmp ( mod, find-> m_name )) {