aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-07-22 00:13:42 +0000
committerRoger Dingledine <arma@torproject.org>2004-07-22 00:13:42 +0000
commit6c56f34aaf43bd25ebb77d66169b29681442d9b6 (patch)
tree002d8d4d449907e8dcfaec11d64ec4d348d77c99 /src/or/dirserv.c
parent3c2c8ed42bdcc26edebb73531e0d6a22ab2fff07 (diff)
downloadtor-6c56f34aaf43bd25ebb77d66169b29681442d9b6.tar.gz
tor-6c56f34aaf43bd25ebb77d66169b29681442d9b6.zip
clients shouldn't create datadir until we have something to put there
svn:r2092
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index cbdfb6b0a7..5351c74931 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -673,9 +673,11 @@ size_t dirserv_get_directory(const char **directory)
exit(0);
}
free(new_directory);
- sprintf(filename,"%s/cached-directory", get_data_directory(&options));
- if(write_str_to_file(filename,the_directory) < 0) {
- log_fn(LOG_WARN, "Couldn't write cached directory to disk. Ignoring.");
+ if(get_data_directory(&options)) {
+ sprintf(filename,"%s/cached-directory", get_data_directory(&options));
+ if(write_str_to_file(filename,the_directory) < 0) {
+ log_fn(LOG_WARN, "Couldn't write cached directory to disk. Ignoring.");
+ }
}
} else {
log(LOG_INFO,"Directory still clean, reusing.");