summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-02-19 23:12:26 +0000
committerRoger Dingledine <arma@torproject.org>2006-02-19 23:12:26 +0000
commit57bcdcecf1209a39572ac771df5a91f3e4d51172 (patch)
treea2d798bf40d2e77cf3614ece51aa4602bd1d9e9b
parent5d1b35ce41cad500d4e4ba39a3757c6ba5f8ed92 (diff)
downloadtor-57bcdcecf1209a39572ac771df5a91f3e4d51172.tar.gz
tor-57bcdcecf1209a39572ac771df5a91f3e4d51172.zip
try to address bug 257: if rename() fails during saveconf, tell
the controller. svn:r6049
-rw-r--r--src/or/config.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index c5ff212a8b..af136f404a 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -3653,7 +3653,12 @@ write_configuration_file(const char *fname, or_options_t *options)
++i;
}
log_notice(LD_CONFIG, "Renaming old configuration file to \"%s\"", fn_tmp);
- rename(fname, fn_tmp);
+ if (rename(fname, fn_tmp) < 0) {
+ log_warn(LD_FS, "Couldn't rename \"%s\" to \"%s\": %s",
+ fname, fn_tmp, strerror(errno));
+ tor_free(fn_tmp);
+ goto err;
+ }
tor_free(fn_tmp);
}