diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-09-08 07:16:34 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-09-08 07:16:34 +0000 |
commit | 0ef85f6dbad170d7757b60c782d2b0df87eafb9d (patch) | |
tree | 548aaf844bde663bbad40ff7cda1350454496a7d /src/or | |
parent | c66e4c48704b8be1425c2b6253542beed49ce0eb (diff) | |
download | tor-0ef85f6dbad170d7757b60c782d2b0df87eafb9d.tar tor-0ef85f6dbad170d7757b60c782d2b0df87eafb9d.tar.gz |
Some platforms have weird translations when you open files in "test" mode; make read/write_str_to_file aware.
svn:r2336
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/dirserv.c | 4 | ||||
-rw-r--r-- | src/or/main.c | 2 | ||||
-rw-r--r-- | src/or/rendservice.c | 2 | ||||
-rw-r--r-- | src/or/router.c | 6 | ||||
-rw-r--r-- | src/or/routerlist.c | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index ba21c0f00..dc7804b3b 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -652,7 +652,7 @@ void dirserv_set_cached_directory(const char *directory, time_t when) cached_directory_published = when; if(get_data_directory(&options)) { sprintf(filename,"%s/cached-directory", get_data_directory(&options)); - if(write_str_to_file(filename,cached_directory) < 0) { + if(write_str_to_file(filename,cached_directory,0) < 0) { log_fn(LOG_WARN, "Couldn't write cached directory to disk. Ignoring."); } } @@ -725,7 +725,7 @@ static int dirserv_regenerate_directory(void) free(new_directory); if(get_data_directory(&options)) { sprintf(filename,"%s/cached-directory", get_data_directory(&options)); - if(write_str_to_file(filename,the_directory) < 0) { + if(write_str_to_file(filename,the_directory,0) < 0) { log_fn(LOG_WARN, "Couldn't write cached directory to disk. Ignoring."); } } diff --git a/src/or/main.c b/src/or/main.c index 9bdebbbb1..b3ec831b7 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -764,7 +764,7 @@ static int do_hup(void) { router_rebuild_descriptor(); sprintf(keydir,"%s/router.desc", get_data_directory(&options)); log_fn(LOG_INFO,"Dumping descriptor to %s...",keydir); - if (write_str_to_file(keydir, router_get_my_descriptor())) { + if (write_str_to_file(keydir, router_get_my_descriptor(), 0)) { return -1; } } diff --git a/src/or/rendservice.c b/src/or/rendservice.c index a0e70be52..cfc584112 100644 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@ -317,7 +317,7 @@ int rend_service_load_keys(void) return -1; } sprintf(buf, "%s.onion\n", s->service_id); - if (write_str_to_file(fname,buf)<0) + if (write_str_to_file(fname,buf,0)<0) return -1; } return 0; diff --git a/src/or/router.c b/src/or/router.c index 2b89bef8d..8eb483643 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -319,7 +319,7 @@ int init_keys(void) { sprintf(keydir,"%s/router.desc", datadir); log_fn(LOG_INFO,"Dumping descriptor to %s...",keydir); - if (write_str_to_file(keydir, mydesc)) { + if (write_str_to_file(keydir, mydesc,0)) { return -1; } /* 5. Dump fingerprint to 'fingerprint' */ @@ -334,7 +334,7 @@ int init_keys(void) { return -1; } strcat(fingerprint, "\n"); - if (write_str_to_file(keydir, fingerprint)) + if (write_str_to_file(keydir, fingerprint, 0)) return -1; if(!authdir_mode()) return 0; @@ -348,7 +348,7 @@ int init_keys(void) { /* 7. [authdirserver only] load old directory, if it's there */ sprintf(keydir,"%s/cached-directory", datadir); log_fn(LOG_INFO,"Loading cached directory from %s...",keydir); - cp = read_file_to_str(keydir); + cp = read_file_to_str(keydir,0); if(!cp) { log_fn(LOG_INFO,"Cached directory %s not present. Ok.",keydir); } else { diff --git a/src/or/routerlist.c b/src/or/routerlist.c index b7187984b..dfd58283c 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -60,7 +60,7 @@ int router_reload_router_list(void) if (get_data_directory(&options)) { char *s; sprintf(filename,"%s/cached-directory", get_data_directory(&options)); - s = read_file_to_str(filename); + s = read_file_to_str(filename,0); if (s) { log_fn(LOG_INFO, "Loading cached directory from %s", filename); if (router_load_routerlist_from_string(s, 0) < 0) { @@ -693,7 +693,7 @@ int router_load_routerlist_from_file(char *routerfile, int trusted) { char *string; - string = read_file_to_str(routerfile); + string = read_file_to_str(routerfile,0); if(!string) { log_fn(LOG_WARN,"Failed to load routerfile %s.",routerfile); return -1; |