mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
try to address bug 257: if rename() fails during saveconf, tell
the controller. svn:r6049
This commit is contained in:
parent
5d1b35ce41
commit
57bcdcecf1
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user