From 4423e5beefd6f17dfa836211899ee70edcc64a5b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 8 Feb 2007 07:03:44 +0000 Subject: /etc/modules.conf is a 2.6.x file while /etc/modules.conf and /etc/conf.modules are 2.4.x and older files --- modutils/modprobe.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modutils/modprobe.c') diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 5e7486a81..57e19b4ab 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -496,11 +496,15 @@ static struct dep_t *build_dep(void) /* * First parse system-specific options and aliases * as they take precedence over the kernel ones. + * >=2.6: we only care about modprobe.conf + * <=2.4: we care about modules.conf and conf.modules */ - if (!ENABLE_FEATURE_2_6_MODULES - || (fd = open("/etc/modprobe.conf", O_RDONLY)) < 0) - if ((fd = open("/etc/modules.conf", O_RDONLY)) < 0) - fd = open("/etc/conf.modules", O_RDONLY); + if (ENABLE_FEATURE_2_6_MODULES + && (fd = open("/etc/modprobe.conf", O_RDONLY)) < 0) + if (ENABLE_FEATURE_2_4_MODULES + && (fd = open("/etc/modules.conf", O_RDONLY)) < 0) + if (ENABLE_FEATURE_2_4_MODULES) + fd = open("/etc/conf.modules", O_RDONLY); if (fd >= 0) { include_conf(&first, ¤t, buffer, sizeof(buffer), fd); -- cgit v1.2.3