[Pkg-shadow-commits] r1515 - in upstream/trunk: . libmisc

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Thu Dec 27 23:30:37 UTC 2007


Author: nekral-guest
Date: 2007-12-27 23:30:36 +0000 (Thu, 27 Dec 2007)
New Revision: 1515

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/libmisc/copydir.c
Log:
Avoid assignment in comparisons.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2007-12-27 23:23:51 UTC (rev 1514)
+++ upstream/trunk/ChangeLog	2007-12-27 23:30:36 UTC (rev 1515)
@@ -7,6 +7,7 @@
 	* libmisc/copydir.c: -1 is used to indicate an error, directly set err
 	to -1, instead of incrementing it, and checking if not nul at the
 	end.
+	* libmisc/copydir.c: Avoid assignment in comparisons.
 
 2007-12-27  Nicolas François  <nicolas.francois at centraliens.net>
 

Modified: upstream/trunk/libmisc/copydir.c
===================================================================
--- upstream/trunk/libmisc/copydir.c	2007-12-27 23:23:51 UTC (rev 1514)
+++ upstream/trunk/libmisc/copydir.c	2007-12-27 23:30:36 UTC (rev 1515)
@@ -185,8 +185,8 @@
 	 * regular files (and directories ...) are copied, and no file
 	 * is made set-ID.
 	 */
-
-	if (!(dir = opendir (src_root)))
+	dir = opendir (src_root);
+	if (NULL == dir)
 		return -1;
 
 	if (src_orig == 0) {
@@ -431,14 +431,15 @@
 	char buf[1024];
 	int cnt;
 
-	if ((ifd = open (src, O_RDONLY)) < 0) {
+	ifd = open (src, O_RDONLY);
+	if (ifd < 0) {
 		return -1;
 	}
 #ifdef WITH_SELINUX
 	selinux_file_context (dst);
 #endif
-	if ((ofd =
-	     open (dst, O_WRONLY | O_CREAT | O_TRUNC, 0)) < 0
+	ofd = open (dst, O_WRONLY | O_CREAT | O_TRUNC, 0);
+	if ((ofd < 0)
 	    || chown (dst,
 	              uid == (uid_t) - 1 ? statp->st_uid : uid,
 	              gid == (gid_t) - 1 ? statp->st_gid : gid)
@@ -495,8 +496,8 @@
 	 * regular files (and directories ...) are copied, and no file
 	 * is made set-ID.
 	 */
-
-	if (!(dir = opendir (root)))
+	dir = opendir (root);
+	if (NULL == dir)
 		return -1;
 
 	while ((ent = readdir (dir))) {




More information about the Pkg-shadow-commits mailing list