[Initng-svn] r1921 - initng/plugins/find

svn at initng.thinktux.net svn at initng.thinktux.net
Thu Nov 3 00:24:32 CET 2005


Author: jimmy
Date: Thu Nov  3 00:24:31 2005
New Revision: 1921

Modified:
   initng/plugins/find/initng_find.c
Log:
Bug, segfault in find module if dir /etc/initng/daemon or /etc/initng/system did not exist.


Modified: initng/plugins/find/initng_find.c
==============================================================================
--- initng/plugins/find/initng_find.c	(original)
+++ initng/plugins/find/initng_find.c	Thu Nov  3 00:24:31 2005
@@ -55,6 +55,8 @@
     assert(service);
 
     path = opendir(INITNG_ROOT "/system");
+    if(path)
+    {
     while ((dir_e = readdir(path)))
     {
         if (strstr(dir_e->d_name, service))
@@ -69,8 +71,11 @@
 
     }
     closedir(path);
-
+    }
+    
     path = opendir(INITNG_ROOT "/daemon");
+    if(path)
+    {
     while ((dir_e = readdir(path)))
     {
         if (strstr(dir_e->d_name, service))
@@ -84,7 +89,8 @@
         }
     }
     closedir(path);
-
+    }
+    
     return (NULL);
 }
 


More information about the Initng-svn mailing list