From 9551f90d8ab85f8d4eefd739bef556635f735f68 Mon Sep 17 00:00:00 2001 From: andersen Date: Fri, 20 Jun 2003 09:57:30 +0000 Subject: Fall back to looking in /lib/modules/modules.dep if /lib/modules//modules.dep is missing git-svn-id: svn://busybox.net/trunk/busybox@6948 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- modutils/modprobe.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modutils/modprobe.c b/modutils/modprobe.c index 13f17b869..b4bff5100 100644 --- a/modutils/modprobe.c +++ b/modutils/modprobe.c @@ -128,8 +128,13 @@ static struct dep_t *build_dep ( void ) strcat ( filename, un.release ); strcat ( filename, "/modules.dep" ); - if (( fd = open ( filename, O_RDONLY )) < 0 ) - return 0; + if (( fd = open ( filename, O_RDONLY )) < 0 ) { + + /* Ok, that didn't work. Fall back to looking in /lib/modules */ + if (( fd = open ( "/lib/modules/modules.dep", O_RDONLY )) < 0 ) { + return 0; + } + } while ( reads ( fd, buffer, sizeof( buffer ))) { int l = bb_strlen ( buffer ); -- cgit v1.2.3-55-g6feb