[aadk-commits] dbailey: uClinux/trunk r369 - /uClinux/trunk/uClinux-dist/user/procwatch/

aadk-commits at lists.digium.com aadk-commits at lists.digium.com
Sat Apr 21 14:41:28 MST 2007


Author: dbailey
Date: Sat Apr 21 16:41:28 2007
New Revision: 369

URL: http://svn.digium.com/view/aadk?view=rev&rev=369
Log:
Corrected bug that was not closing directory structure in certain instances

Modified:
    uClinux/trunk/uClinux-dist/user/procwatch/procwatch.c

Modified: uClinux/trunk/uClinux-dist/user/procwatch/procwatch.c
URL: http://svn.digium.com/view/aadk/uClinux/trunk/uClinux-dist/user/procwatch/procwatch.c?view=diff&rev=369&r1=368&r2=369
==============================================================================
--- uClinux/trunk/uClinux-dist/user/procwatch/procwatch.c (original)
+++ uClinux/trunk/uClinux-dist/user/procwatch/procwatch.c Sat Apr 21 16:41:28 2007
@@ -118,9 +118,8 @@
 	}
 	
 	while(1){
-		if(0 == find_processes(proc_monitor, num_to_monitor)){
+		if(0 == find_processes(proc_monitor, num_to_monitor))
 			write(fd_watchdog, "\0", 1);
-		}
 		// Sleep between checking for processes
 		usleep(1000 * sleep_val);
 	}
@@ -191,12 +190,9 @@
 		
 /* while I have not accounted for all the processes I need to check */
 	while(0 < unfound_process || 0 < offline_process) {
-		if((entry = readdir(dir)) == NULL) {
+		if((entry = readdir(dir)) == NULL) 
 			/* cannot read more entries, time to get out */
-			closedir(dir);
-			dir = NULL;
 			break; 
-		}
 		proc_id_name = entry->d_name;
 		if (!(*proc_id_name >= '0' && *proc_id_name <= '9')) {/* look for decimal numeric name */
 			continue;
@@ -270,6 +266,8 @@
 			}
 		}
 	}
+	closedir(dir);
+	dir = NULL;
 	return unfound_process;
 }	
 



More information about the aadk-commits mailing list