]> git.sesse.net Git - cubemap/commitdiff
Fix more missing log_perror() calls.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:28:22 +0000 (19:28 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:28:22 +0000 (19:28 +0200)
There's nothing we can do about them, but it's good to report.

Found by Coverity Scan.

stats.cpp

index 8e4443cf14d4f2ce478c702a1bbb0127fa8f461b..4e82d7f3395f206ed0b750d6b72980cf4c796d9a 100644 (file)
--- a/stats.cpp
+++ b/stats.cpp
@@ -44,8 +44,12 @@ void StatsThread::do_work()
                fp = fdopen(fd, "w");
                if (fp == NULL) {
                        log_perror("fdopen");
-                       close(fd);
-                       unlink(filename);
+                       if (close(fd) == -1) {
+                               log_perror("close");
+                       }
+                       if (unlink(filename) == -1) {
+                               log_perror(filename);
+                       }
                        free(filename);
                        goto sleep;
                }
@@ -65,13 +69,17 @@ void StatsThread::do_work()
                }
                if (fclose(fp) == EOF) {
                        log_perror("fclose");
-                       unlink(filename);
+                       if (unlink(filename) == -1) {
+                               log_perror(filename);
+                       }
                        free(filename);
                        goto sleep;
                }
                
                if (rename(filename, stats_file.c_str()) == -1) {
-                       log_perror("rename");
+                       if (unlink(filename) == -1) {
+                               log_perror(filename);
+                       }
                        unlink(filename);
                }
                free(filename);