From 5cbc8875736986079cfd83969fd1ce6941c3ac3a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 18 Mar 2008 16:09:07 +0000 Subject: r18931@catbus: nickm | 2008-03-18 12:08:44 -0400 Backport to 0.1.2: Detect errors from directory listing correctly on win32. Bug found by lodger. svn:r14104 --- ChangeLog | 5 +++-- src/common/util.c | 2 +- src/or/control.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d3bc5a2d5..8ab5bdb213 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Changes in versino 0.1.2.20 - 2008-??-?? +Changes in version 0.1.2.20 - 2008-??-?? o Major bugfixes: - Patch from "Andrew S. Lists" to catch when we contact a directory mirror at IP address X and he says we look like we're coming from @@ -21,7 +21,8 @@ Changes in versino 0.1.2.20 - 2008-??-?? cached-descriptors file. Patch by freddy77. - Detect size overflow in zlib code. - Fix a pointer error that kept us from reporting nameserver errors. - + - On Windows, correctly detect errors when listing the contents of a + directory. Fix from lodger. Changes in version 0.1.2.19 - 2008-01-17 Tor 0.1.2.19 fixes a huge memory leak on exit relays, makes the default diff --git a/src/common/util.c b/src/common/util.c index 04b59782eb..ee9854f1c7 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1607,7 +1607,7 @@ tor_listdir(const char *dirname) size_t pattern_len = strlen(dirname)+16; pattern = tor_malloc(pattern_len); tor_snprintf(pattern, pattern_len, "%s\\*", dirname); - if (!(handle = FindFirstFile(pattern, &findData))) { + if (INVALID_HANDLE_VALUE == (handle = FindFirstFile(pattern, &findData))) { tor_free(pattern); return NULL; } diff --git a/src/or/control.c b/src/or/control.c index 459b3f40c8..d7a7177eb5 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -3192,7 +3192,7 @@ control_event_status(int type, int severity, const char *format, va_list args) status = "STATUS_CLIENT"; break; case EVENT_STATUS_SERVER: - status = "STATUS_SEVER"; + status = "STATUS_SERVER"; break; default: log_warn(LD_BUG, "Unrecognized status type %d", type); -- cgit v1.2.3-54-g00ecf