aboutsummaryrefslogtreecommitdiff
path: root/init.d
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2014-07-16 12:07:56 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2014-07-16 12:16:39 -0700
commite9212e5164877056cb44bd1be542f0ab8c1c0f1a (patch)
treee41769b645c940463c8962d97dab465f72a1824d /init.d
parentBump. (diff)
downloadnetifrc-e9212e5164877056cb44bd1be542f0ab8c1c0f1a.tar.gz
netifrc-e9212e5164877056cb44bd1be542f0ab8c1c0f1a.tar.bz2
netifrc-e9212e5164877056cb44bd1be542f0ab8c1c0f1a.zip
net.lo: cached module list timing issue
Handle cached modulelist being newer than current time, as it would not be recached even when needed; force recache. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Gentoo-Bug: 506966 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=506966
Diffstat (limited to 'init.d')
-rw-r--r--init.d/net.lo.in24
1 files changed, 14 insertions, 10 deletions
diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index 5ea73c7..01c1b20 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -218,16 +218,20 @@ _show_address()
_gen_module_list()
{
local x= f= force=$1
- if ! ${force} && [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ]; then
- local update=false
- for x in "${MODULESDIR}"/*.sh; do
- [ -e "${x}" ] || continue
- if [ "${x}" -nt "${MODULESLIST}" ]; then
- update=true
- break
- fi
- done
- ${update} || return 0
+ if ! ${force} ; then
+ if [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt /proc/$$/status ]; then
+ ewarn "Discarding cached module list ($MODULESLIST) as it's newer current time!"
+ elif [ -s "${MODULESLIST}" -a "${MODULESLIST}" -nt "${MODULESDIR}" ]; then
+ local update=false
+ for x in "${MODULESDIR}"/*.sh; do
+ [ -e "${x}" ] || continue
+ if [ "${x}" -nt "${MODULESLIST}" ]; then
+ update=true
+ break
+ fi
+ done
+ ${update} || return 0
+ fi
fi
einfo "Caching network module dependencies"