]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Log an error on win32 if directory listing fails.
authorNick Mathewson <nickm@torproject.org>
Thu, 18 Dec 2008 16:11:12 +0000 (16:11 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 18 Dec 2008 16:11:12 +0000 (16:11 +0000)
svn:r17684

src/common/util.c

index b75ebf18cb540b30a628c0b54f2daf7325b8db7e..9bd974a155b7e43bee3b650349ed25a965ee5350 100644 (file)
@@ -2158,9 +2158,11 @@ tor_listdir(const char *dirname)
       smartlist_add(result, tor_strdup(findData.cFileName));
     }
     if (!FindNextFile(handle, &findData)) {
-      if (GetLastError() != ERROR_NO_MORE_FILES) {
-        /* XXX021 can we say what the error is? */
-        log_warn(LD_FS, "Error reading directory '%s'.", dirname);
+      DWORD err;
+      if ((err = GetLastError()) != ERROR_NO_MORE_FILES) {
+        char *errstr = format_win32_error(err);
+        log_warn(LD_FS, "Error reading directory '%s': %s", dirname, errstr);
+        tor_free(errstr);
       }
       break;
     }