aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-03-18 16:09:07 +0000
committerNick Mathewson <nickm@torproject.org>2008-03-18 16:09:07 +0000
commit5cbc8875736986079cfd83969fd1ce6941c3ac3a (patch)
tree487b85c7c6c3738b8840cdbd95ed95faa99f8a42
parent69198d015617260a1103953c2fce6adc78a15fde (diff)
downloadtor-5cbc8875736986079cfd83969fd1ce6941c3ac3a.tar.gz
tor-5cbc8875736986079cfd83969fd1ce6941c3ac3a.zip
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
-rw-r--r--ChangeLog5
-rw-r--r--src/common/util.c2
-rw-r--r--src/or/control.c2
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);