소스 검색

Don't warn on unlink(bw_accounting) when errno == ENOENT

Patch from pastly; fixes bug 19964.
Nick Mathewson 7 년 전
부모
커밋
bbac9e1d0c
2개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 0
      changes/bug19964
  2. 1 1
      src/or/hibernate.c

+ 6 - 0
changes/bug19964

@@ -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'.
+

+ 1 - 1
src/or/hibernate.c

@@ -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));