[or-cvs] r17684: {tor} Log an error on win32 if directory listing fails. (tor/trunk/src/common)
nickm at seul.org
nickm at seul.org
Thu Dec 18 16:11:14 UTC 2008
Author: nickm
Date: 2008-12-18 11:11:12 -0500 (Thu, 18 Dec 2008)
New Revision: 17684
Modified:
tor/trunk/src/common/util.c
Log:
Log an error on win32 if directory listing fails.
Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c 2008-12-18 16:11:08 UTC (rev 17683)
+++ tor/trunk/src/common/util.c 2008-12-18 16:11:12 UTC (rev 17684)
@@ -2158,9 +2158,11 @@
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;
}
More information about the tor-commits
mailing list