aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-18 16:11:12 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-18 16:11:12 +0000
commit8d5a9d762c94b481d2f1326a14bba5b9c50624a8 (patch)
treea83ecf0c3dc55dbafaf9fb68d1b3866a32921ea4 /src/common/util.c
parentc449e6e5bef46762560d53eb9b517906186abcf6 (diff)
downloadtor-8d5a9d762c94b481d2f1326a14bba5b9c50624a8.tar.gz
tor-8d5a9d762c94b481d2f1326a14bba5b9c50624a8.zip
Log an error on win32 if directory listing fails.
svn:r17684
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c
index b75ebf18cb..9bd974a155 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -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;
}