Add a missing log_perror() on close() failure (cosmetic issue).
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:25:59 +0000 (19:25 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:25:59 +0000 (19:25 +0200)
Found by Coverity Scan.

util.cpp

index 45bf5b5..d6d39f2 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -33,7 +33,9 @@ int make_tempfile(const std::string &contents)
                ssize_t ret = write(fd, ptr, to_write);
                if (ret == -1) {
                        log_perror("write");
-                       close(fd);
+                       if (close(fd) == -1) {
+                               log_perror("close");
+                       }
                        return -1;
                }