Check the return code from close() and output an error if it
fails.
diff --git a/receiver.c b/receiver.c
index 108c856..1975e58 100644
--- a/receiver.c
+++ b/receiver.c
@@ -458,7 +458,11 @@
 		if (fd1 != -1) {
 			close(fd1);
 		}
-		close(fd2);
+		if (close(fd2) < 0) {
+			rprintf(FERROR, "close failed on %s: %s\n",
+				full_fname(fnametmp), strerror(errno));
+			exit_cleanup(RERR_FILEIO);
+		}
 
 		if (verbose > 2)
 			rprintf(FINFO,"renaming %s to %s\n",fnametmp,fname);