diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-07-09 22:28:12 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-07-09 22:28:12 +0000 |
commit | a7a1d4e3d35621f048e908093370c7768a431eeb (patch) | |
tree | 48bb0795210b967d38e0d89b5650d1547693d1b1 /src/or | |
parent | 51454157a0646b91f0d024477a0ee185f82df58b (diff) | |
download | tor-a7a1d4e3d35621f048e908093370c7768a431eeb.tar tor-a7a1d4e3d35621f048e908093370c7768a431eeb.tar.gz |
First part of making mmap-based stuff work on win32: save descriptors as "binary" (no LF->CRLF tanslation) so that we can mmap them properly later. Patch from Frediano Ziglio.
svn:r6748
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/routerlist.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 65f0bb764..6c4c82347 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -181,7 +181,7 @@ router_append_to_journal(signed_descriptor_t *desc) tor_assert(len == strlen(body)); - if (append_bytes_to_file(fname, body, len, 0)) { + if (append_bytes_to_file(fname, body, len, 1)) { log_warn(LD_FS, "Unable to store router descriptor"); tor_free(fname); return -1; @@ -271,7 +271,7 @@ router_rebuild_store(int force) smartlist_add(chunk_list, c); }); } - if (write_chunks_to_file(fname, chunk_list, 0)<0) { + if (write_chunks_to_file(fname, chunk_list, 1)<0) { log_warn(LD_FS, "Error writing router store to disk."); goto done; } @@ -308,7 +308,7 @@ router_rebuild_store(int force) tor_snprintf(fname, fname_len, "%s/cached-routers.new", options->DataDirectory); - write_str_to_file(fname, "", 0); + write_str_to_file(fname, "", 1); r = 0; router_store_len = len; @@ -350,7 +350,7 @@ router_reload_router_list(void) tor_snprintf(fname, fname_len, "%s/cached-routers.new", options->DataDirectory); - contents = read_file_to_str(fname, 0); + contents = read_file_to_str(fname, 1); if (contents) { stat(fname, &st); router_load_routers_from_string(contents, |