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

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Thu Apr 30 21:53:54 UTC 2009


Author: nekral-guest
Date: 2009-04-30 21:53:54 +0000 (Thu, 30 Apr 2009)
New Revision: 2853

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/commonio.c
Log:
	* lib/commonio.c: Ignore teh return values of fclose() and
	unlink() in case of failure of fopen_set_perms() or
	create_backup().
	* lib/commonio.c: Should the backup file be unlink'ed in case of
	failure of create_backup()?


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2009-04-30 21:44:35 UTC (rev 2852)
+++ upstream/trunk/ChangeLog	2009-04-30 21:53:54 UTC (rev 2853)
@@ -1,5 +1,13 @@
 2009-04-30  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* lib/commonio.c: Ignore teh return values of fclose() and
+	unlink() in case of failure of fopen_set_perms() or
+	create_backup().
+	* lib/commonio.c: Should the backup file be unlink'ed in case of
+	failure of create_backup()?
+
+2009-04-30  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* lib/getulong.c: Added splint annotations.
 
 2009-04-30  Nicolas François  <nicolas.francois at centraliens.net>

Modified: upstream/trunk/lib/commonio.c
===================================================================
--- upstream/trunk/lib/commonio.c	2009-04-30 21:44:35 UTC (rev 2852)
+++ upstream/trunk/lib/commonio.c	2009-04-30 21:53:54 UTC (rev 2853)
@@ -222,8 +222,9 @@
 	return fp;
 
       fail:
-	fclose (fp);
-	unlink (name);
+	(void) fclose (fp);
+	/* fopen_set_perms is used for intermediate files */
+	(void) unlink (name);
 	return NULL;
 }
 
@@ -257,11 +258,13 @@
 		}
 	}
 	if ((c != EOF) || (ferror (fp) != 0) || (fflush (bkfp) != 0)) {
-		fclose (bkfp);
+		(void) fclose (bkfp);
+		/* FIXME: unlink the backup file? */
 		return -1;
 	}
 	if (   (fsync (fileno (bkfp)) != 0)
 	    || (fclose (bkfp) != 0)) {
+		/* FIXME: unlink the backup file? */
 		return -1;
 	}
 




More information about the Pkg-shadow-commits mailing list