diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-10-19 23:05:02 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-10-19 23:05:02 +0000 |
commit | 7551c44a5375c390b653c7b8f28d904a3156e1ae (patch) | |
tree | f68e822086b38828df32583d165135fc148c4768 /src/or/config.c | |
parent | 126a3f699a8ed6f9c4d2b6c5f4b09f8be159fdd8 (diff) | |
download | tor-7551c44a5375c390b653c7b8f28d904a3156e1ae.tar.gz tor-7551c44a5375c390b653c7b8f28d904a3156e1ae.zip |
r9274@Kushana: nickm | 2006-10-19 16:16:58 -0400
Add unit tests for tor_mmap_file(); make tor_mmap_t.size always be the size of the file (not the size of the mapping); add an extra argument to read_file_to_str() so it can return the size of the result string.
svn:r8762
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/config.c b/src/or/config.c index b3934c4f6c..1a7b6c8a07 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2801,7 +2801,7 @@ options_init_from_torrc(int argc, char **argv) /* get config lines, assign them */ if (file_status(fname) != FN_FILE || - !(cf = read_file_to_str(fname,0))) { + !(cf = read_file_to_str(fname,0,NULL))) { if (using_default_torrc == 1) { log(LOG_NOTICE, LD_CONFIG, "Configuration file \"%s\" not present, " "using reasonable defaults.", fname); @@ -3421,7 +3421,7 @@ write_configuration_file(const char *fname, or_options_t *options) if (fname) { switch (file_status(fname)) { case FN_FILE: - old_val = read_file_to_str(fname, 0); + old_val = read_file_to_str(fname, 0, NULL); if (strcmpstart(old_val, GENERATED_FILE_PREFIX)) { rename_old = 1; } @@ -3835,7 +3835,7 @@ or_state_load(void) fname = get_or_state_fname(); switch (file_status(fname)) { case FN_FILE: - if (!(contents = read_file_to_str(fname, 0))) { + if (!(contents = read_file_to_str(fname, 0, NULL))) { log_warn(LD_FS, "Unable to read state file \"%s\"", fname); goto done; } |