]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Log real error message when unable to remove a storagedir file
authorNick Mathewson <nickm@torproject.org>
Wed, 28 Jun 2017 18:24:27 +0000 (14:24 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 28 Jun 2017 18:24:27 +0000 (14:24 -0400)
Attempts to help diagnose 22752.

src/common/storagedir.c

index 4405731884c24307557e8bda6fe467f5a5fa569e..31933f64c2769af901303bab6aa137c91ed500db 100644 (file)
@@ -119,7 +119,8 @@ storage_dir_clean_tmpfiles(storage_dir_t *d)
     char *path = NULL;
     tor_asprintf(&path, "%s/%s", d->directory, fname);
     if (unlink(sandbox_intern_string(path))) {
-      log_warn(LD_FS, "Unable to unlink %s", escaped(path));
+      log_warn(LD_FS, "Unable to unlink %s while cleaning "
+               "temporary files: %s", escaped(path), strerror(errno));
       tor_free(path);
       continue;
     }
@@ -455,7 +456,8 @@ storage_dir_remove_file(storage_dir_t *d,
   if (unlink(ipath) == 0) {
     storage_dir_reduce_usage(d, size);
   } else {
-    log_warn(LD_FS, "Unable to unlink %s", escaped(path));
+    log_warn(LD_FS, "Unable to unlink %s while removing file: %s",
+             escaped(path), strerror(errno));
     tor_free(path);
     return;
   }