[Pkg-shadow-commits] r2799 - in upstream/trunk: . lib

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Fri Apr 24 23:35:01 UTC 2009


Author: nekral-guest
Date: 2009-04-24 23:35:01 +0000 (Fri, 24 Apr 2009)
New Revision: 2799

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/commonio.c
Log:
	* lib/commonio.c: Use get_pid() instead of strtol.
	* lib/commonio.c: Replace an int by a size_t.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-24 23:33:47 UTC (rev 2798)
+++ upstream/trunk/ChangeLog	2009-04-24 23:35:01 UTC (rev 2799)
@@ -1,5 +1,10 @@
 2009-04-25  Nicolas François  <nicolas.francois at 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 at centraliens.net>
+
 	* lib/commonio.h: Added splint annotations.
 
 2009-04-25  Nicolas François  <nicolas.francois at centraliens.net>

Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c	2009-04-24 23:33:47 UTC (rev 2798)
+++ upstream/trunk/lib/commonio.c	2009-04-24 23:35:01 UTC (rev 2799)
@@ -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 @@
 		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 @@
 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++;




More information about the Pkg-shadow-commits mailing list