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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Fri Jun 13 21:53:42 UTC 2008


Author: nekral-guest
Date: 2008-06-13 21:53:41 +0000 (Fri, 13 Jun 2008)
New Revision: 2173

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/commonio.c
Log:
	* lib/commonio.c: len should be typed ssize_t as it is the return
	of read(), and is compared to 0. Cast to size_t when necessary.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-06-13 21:49:57 UTC (rev 2172)
+++ upstream/trunk/ChangeLog	2008-06-13 21:53:41 UTC (rev 2173)
@@ -1,5 +1,10 @@
 2008-06-13  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* lib/commonio.c: len should be typed ssize_t as it is the return
+	of read(), and is compared to 0. Cast to size_t when necessary.
+
+2008-06-13  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* libmisc/find_new_ids.c: Use getdef_ulong to retrieve UIDs/GIDs
 	from login.defs. Type constants to long integers.
 

Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c	2008-06-13 21:49:57 UTC (rev 2172)
+++ upstream/trunk/lib/commonio.c	2008-06-13 21:53:41 UTC (rev 2173)
@@ -113,7 +113,7 @@
 {
 	int fd;
 	pid_t pid;
-	size_t len;
+	ssize_t len;
 	int retval;
 	char buf[32];
 
@@ -124,8 +124,8 @@
 
 	pid = getpid ();
 	snprintf (buf, sizeof buf, "%lu", (unsigned long) pid);
-	len = strlen (buf) + 1;
-	if (write (fd, buf, len) != (ssize_t) len) {
+	len = (ssize_t) strlen (buf) + 1;
+	if (write (fd, buf, (size_t) len) != len) {
 		(void) close (fd);
 		unlink (file);
 		return 0;




More information about the Pkg-shadow-commits mailing list