commit:     e9212e5164877056cb44bd1be542f0ab8c1c0f1a
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 16 19:07:56 2014 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Wed Jul 16 19:16:39 2014 +0000
URL:        
http://git.overlays.gentoo.org/gitweb/?p=proj/netifrc.git;a=commit;h=e9212e51

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 <AT> gentoo.org>
X-Gentoo-Bug: 506966
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=506966

---
 init.d/net.lo.in | 24 ++++++++++++++----------
 1 file 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"

Reply via email to