]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't warn on unlink(bw_accounting) when errno == ENOENT
authorNick Mathewson <nickm@torproject.org>
Wed, 31 Aug 2016 14:57:09 +0000 (10:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 31 Aug 2016 14:57:09 +0000 (10:57 -0400)
Patch from pastly; fixes bug 19964.

changes/bug19964 [new file with mode: 0644]
src/or/hibernate.c

diff --git a/changes/bug19964 b/changes/bug19964
new file mode 100644 (file)
index 0000000..af71942
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes (logging):
+    - When we are unable to remove the bw_accounting file, do not warn
+      if the reason we couldn't remove it was that it didn't exist.
+      Fixes bug 19964; bugfix on 0.2.5.4-alpha. Patch
+      from 'pastly'.
+
index 209aae01cffb7d31e24b1466acf151a62fbb8188..7e253062345de076aa38aa0bdaef0ba06b667d13 100644 (file)
@@ -692,7 +692,7 @@ read_bandwidth_usage(void)
     int res;
 
     res = unlink(fname);
-    if (res != 0) {
+    if (res != 0 && errno != ENOENT) {
       log_warn(LD_FS,
                "Failed to unlink %s: %s",
                fname, strerror(errno));