Fix some issues with the last stats.cpp fix.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:40:38 +0000 (19:40 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 19 Apr 2013 17:40:38 +0000 (19:40 +0200)
stats.cpp

index 4e82d7f..b2bca75 100644 (file)
--- a/stats.cpp
+++ b/stats.cpp
@@ -77,10 +77,10 @@ void StatsThread::do_work()
                }
                
                if (rename(filename, stats_file.c_str()) == -1) {
+                       log_perror("rename");
                        if (unlink(filename) == -1) {
                                log_perror(filename);
                        }
-                       unlink(filename);
                }
                free(filename);