up: Notice errors on both file handles
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 17:19:53 +0000 (17:19 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Sun, 24 Feb 2013 19:15:16 +0000 (11:15 -0800)
Report errors on both filehandles in up's Copy routine, rather
than just on the second one that we close.

Caught by clang-analyzer

Change-Id: Ia3aa9be91ccfca2993a4f27c291332e0b0d350f5
Reviewed-on: http://gerrit.openafs.org/9192
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/venus/up.c

index 522dc08..f253875 100644 (file)
@@ -296,6 +296,10 @@ Copy(char *file1, char *file2, short recursive, int level)
 
            /* Close the files */
            code = close(f1);
+           if (code < 0) {
+               perror("close ");
+               rcode = 1;
+           }
            code = close(f2);
            if (code < 0) {
                perror("close ");