--- modutils-2.4.25/util/config.c.orig 2003-08-09 18:20:57 +0400 +++ modutils-2.4.25/util/config.c 2003-08-09 19:26:55 +0400 @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -187,8 +188,7 @@ static int need_update (const char *forc gen_file[i].mtime = tmp.st_mtime; } - if (stat ("/etc/modules.conf", &tmp) && - stat ("/etc/conf.modules", &tmp)) + if (stat (config_file, &tmp)) return 1; for (i = 0; i < gen_file_count; ++i) { @@ -474,6 +474,8 @@ static int gen_file_check(struct gen_fil return(ret); } +static int do_read_x(int all, char *force_ver, char *base_dir, char *conf_file, int depth); + /* * Read the configuration file. * If parameter "all" == 0 then ignore everything except path info @@ -822,9 +824,12 @@ static int do_read(int all, char *force_ if (fin) { struct stat statbuf1, statbuf2; - if (fstat(fileno(fin), &statbuf1) == 0) + if (fstat(fileno(fin), &statbuf1) == 0 && statbuf1.st_mtime >= config_mtime) { + /* Save name and mtime actually used */ config_mtime = statbuf1.st_mtime; - config_file = xstrdup(conf_file); /* Save name actually used */ + free(config_file); + config_file = xstrdup(conf_file); + } if (!conf_file_specified && stat(ETC_MODULES_CONF, &statbuf1) == 0 && stat(old_name, &statbuf2) == 0) { @@ -1105,17 +1110,17 @@ static int do_read(int all, char *force_ if (g.pathc>0) { for ( ; inc_idx