summaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-08-26 22:03:57 +0000
committerNick Mathewson <nickm@torproject.org>2005-08-26 22:03:57 +0000
commit3cc960c7dd9312f1a5cd9141e7b526f385fcfa06 (patch)
tree5811f964e91f7595cde1f2eb12ae289c66c78afd /src/or/config.c
parent77f52e346767a7539cc797163462a800e249b156 (diff)
downloadtor-3cc960c7dd9312f1a5cd9141e7b526f385fcfa06.tar.gz
tor-3cc960c7dd9312f1a5cd9141e7b526f385fcfa06.zip
Make sure that cached-status directory exists.
svn:r4865
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/config.c b/src/or/config.c
index aaf4cf08fa..642fb30ab5 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -408,6 +408,8 @@ static int
options_act(or_options_t *old_options)
{
config_line_t *cl;
+ char *fn;
+ size_t len;
or_options_t *options = get_options();
static int libevent_initialized = 0;
@@ -446,6 +448,15 @@ options_act(or_options_t *old_options)
options->DataDirectory);
return -1;
}
+ len = strlen(options->DataDirectory)+32;
+ fn = tor_malloc(len);
+ tor_snprintf(fn, len, "%s/cached-status", options->DataDirectory);
+ if (check_private_dir(fn, CPD_CREATE) != 0) {
+ log_fn(LOG_ERR, "Couldn't access/create private data directory \"%s\"",fn);
+ tor_free(fn);
+ return -1;
+ }
+ tor_free(fn);
/* Bail out at this point if we're not going to be a client or server:
* we want to not fork, and to log stuff to stderr. */