[Initng-svn] r3177 - initng/trunk/plugins/daemon

svn at initng.thinktux.net svn at initng.thinktux.net
Fri Mar 3 12:34:41 CET 2006


Author: deac
Date: Fri Mar  3 12:34:40 2006
New Revision: 3177

Modified:
   initng/trunk/plugins/daemon/initng_daemon.c
Log:
pid_file fetch the first founded digits and use it as pid.

Modified: initng/trunk/plugins/daemon/initng_daemon.c
==============================================================================
--- initng/trunk/plugins/daemon/initng_daemon.c	(original)
+++ initng/trunk/plugins/daemon/initng_daemon.c	Fri Mar  3 12:34:40 2006
@@ -1021,9 +1021,16 @@
         return (-1);
     }
 
-    for (i = 0; isdigit(buf[i]); i++)
+	for (i = 0; i < len && ! isdigit( buf[i]); i++);
+
+    for (; i < len && isdigit(buf[i]); i++)
         ret = ret * 10 - '0' + buf[i];
 
+	if( !ret && i >= len)
+		F_( "bufferoverrun: no pid fetched from '%s'.", name);
+	else if( ret && i >= len)
+		F_( "bufferoverrun: i hope, the fetched from '%s' digits are the pid (%i).", name, ret);
+
     return ret;
 }
 


More information about the Initng-svn mailing list