[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-svn
Subject:    [Ipcop-svn] SF.net SVN: ipcop:[3498]
From:       owes () users ! sourceforge ! net
Date:       2009-08-27 13:14:55
Message-ID: E1MgeoZ-00040o-0G () 74yxhf1 ! ch3 ! sourceforge ! com
[Download RAW message or body]

Revision: 3498
          http://ipcop.svn.sourceforge.net/ipcop/?rev=3498&view=rev
Author:   owes
Date:     2009-08-27 13:14:54 +0000 (Thu, 27 Aug 2009)

Log Message:
-----------
Use strtol instead of atoi.

Modified Paths:
--------------
    ipcop/trunk/src/installer/helper.c

Modified: ipcop/trunk/src/installer/helper.c
===================================================================
--- ipcop/trunk/src/installer/helper.c	2009-08-26 14:01:50 UTC (rev 3497)
+++ ipcop/trunk/src/installer/helper.c	2009-08-27 13:14:54 UTC (rev 3498)
@@ -23,6 +23,7 @@
  * 
  */
 
+#include <errno.h>
 #include <malloc.h>
 #include <signal.h>
 #include <stdarg.h>
@@ -161,14 +162,15 @@
     }
 
     close(fd);
-    pid = atoi(buffer);
-    if (pid <= 1) {
+    errno = 0;
+    pid = (int) strtol(buffer, (char **) NULL, 10);
+    if (errno || pid <= 1) {
         fprintf(stderr, "Bad pid value (%d) in pid file (%s)\n", pid, pidfile);
         return FAILURE;
     }
     else {
         if (kill(pid, signal) == -1) {
-            fprintf(stderr, "Unable to send signal (%d) to pid file (%s)\n", signal, \
pidfile); +            fprintf(stderr, "Unable to send signal (%d) to pid file \
(%s,%d)\n", signal, pidfile, pid);  return FAILURE;
         }
     }


This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic