aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-12-07 15:06:38 +0000
committerNick Mathewson <nickm@torproject.org>2006-12-07 15:06:38 +0000
commit97e5e78afd8acba67abc4a12d997ee81a8def0f7 (patch)
treebf84dc4a0ec8f95dc1b873f2f17520966018a255 /src/or
parent02b3b0493928f367cde9e24e46b66d0a4980aace (diff)
downloadtor-97e5e78afd8acba67abc4a12d997ee81a8def0f7.tar.gz
tor-97e5e78afd8acba67abc4a12d997ee81a8def0f7.zip
r11451@Kushana: nickm | 2006-12-07 10:06:30 -0500
Apparently Windows takes a dim view of unlinking a file while it is mapped. Silly windows, did nobody ever tell you about inodes? svn:r9038
Diffstat (limited to 'src/or')
-rw-r--r--src/or/test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/test.c b/src/or/test.c
index 8ec435b2e2..d805ca69c2 100644
--- a/src/or/test.c
+++ b/src/or/test.c
@@ -1295,10 +1295,14 @@ test_mmap(void)
test_assert(mapping);
test_eq(mapping->size, strlen("Short file."));
test_streq(mapping->data, "Short file.");
+#ifdef MS_WINDOWS
+ tor_munmap_file(mapping);
+ test_assert(unlink(fname1) == 0);
+#else
/* make sure we can unlink. */
test_assert(unlink(fname1) == 0);
test_streq(mapping->data, "Short file.");
- tor_munmap_file(mapping);
+#endif
/* Make sure that we fail to map a no-longer-existent file. */
mapping = tor_mmap_file(fname1);
@@ -1316,6 +1320,7 @@ test_mmap(void)
test_assert(mapping);
test_eq(mapping->size, 16384);
test_memeq(mapping->data, buf, 16384);
+ tor_munmap_file(mapping);
/* fname1 got unlinked above */
unlink(fname2);