svn rev #22043: trunk/src/appl/bsd/

ghudson@MIT.EDU ghudson at MIT.EDU
Fri Feb 20 14:13:00 EST 2009


http://src.mit.edu/fisheye/changelog/krb5/?cs=22043
Commit By: ghudson
Log Message:
In krcp, check the return value when closing the output file after
successfully writing it.  close cannot return an error status on most
local filesystems, but can on some network filesystems such as AFS or
NFS.



Changed Files:
U   trunk/src/appl/bsd/krcp.c
Modified: trunk/src/appl/bsd/krcp.c
===================================================================
--- trunk/src/appl/bsd/krcp.c	2009-02-20 18:48:26 UTC (rev 22042)
+++ trunk/src/appl/bsd/krcp.c	2009-02-20 19:13:00 UTC (rev 22043)
@@ -1115,7 +1115,8 @@
 	  wrerr++;
 	if (ftruncate(of, size))
 	  error("rcp: can't truncate %s: %s\n", nambuf, error_message(errno));
-	(void) close(of);
+	if (close(of) != 0)
+	    error("rcp: error closing %s: %s\n", nambuf, error_message(errno));
 	(void) response();
 	if (setimes) {
 	    setimes = 0;




More information about the cvs-krb5 mailing list