]> granicus.if.org Git - shadow/commitdiff
* lib/commonio.c: Use get_pid() instead of strtol.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 24 Apr 2009 23:35:01 +0000 (23:35 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 24 Apr 2009 23:35:01 +0000 (23:35 +0000)
* lib/commonio.c: Replace an int by a size_t.

ChangeLog
lib/commonio.c

index 1b71df0780b9fb4c6bebe7f1850c2315e65109ee..90c2dc7d18c3a0e3c6d8325de0f9a31f762bf921 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-25  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * lib/commonio.c: Use get_pid() instead of strtol.
+       * lib/commonio.c: Replace an int by a size_t.
+
 2009-04-25  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/commonio.h: Added splint annotations.
index 5cfd9babb2aad626f6cb224962210e1b2952db58..afe1e0772b30407d0bee4cc21decb18b4b0871f6 100644 (file)
@@ -48,6 +48,7 @@
 #include <selinux/selinux.h>
 static security_context_t old_context = NULL;
 #endif
+#include "prototypes.h"
 #include "commonio.h"
 
 /* local function prototypes */
@@ -152,9 +153,7 @@ static int do_lock_file (const char *file, const char *lock)
                return 0;
        }
        buf[len] = '\0';
-       /* FIXME: use a get_pid */
-       pid = strtol (buf, (char **) 0, 10);
-       if (0 == pid) {
+       if (get_pid (buf, &pid) == 0) {
                unlink (file);
                errno = EINVAL;
                return 0;
@@ -638,7 +637,7 @@ int
 commonio_sort (struct commonio_db *db, int (*cmp) (const void *, const void *))
 {
        struct commonio_entry **entries, *ptr;
-       int n = 0, i;
+       size_t n = 0, i;
 
        for (ptr = db->head; NULL != ptr; ptr = ptr->next) {
                n++;