aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2010-02-22 12:21:58 +0100
committerSebastian Hahn <sebastian@torproject.org>2010-02-22 12:21:58 +0100
commit1dfbec482c50dabd2359d74848a13cbc03c4f9ea (patch)
treecafcf0bc979572ee88de2e3903f8e93ea697f339 /src
parentd41030436cc9b7473bb4f21bc492309553374b78 (diff)
downloadtor-1dfbec482c50dabd2359d74848a13cbc03c4f9ea.tar
tor-1dfbec482c50dabd2359d74848a13cbc03c4f9ea.tar.gz
Remove some redundant code in options_save_current()
get_torrc_fname() does the same thing we did in this code, so let's replace it.
Diffstat (limited to 'src')
-rw-r--r--src/or/config.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/or/config.c b/src/or/config.c
index b8813877f..0453904e8 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4628,15 +4628,12 @@ write_configuration_file(const char *fname, or_options_t *options)
int
options_save_current(void)
{
- if (torrc_fname) {
- /* This fails if we can't write to our configuration file.
- *
- * If we try falling back to datadirectory or something, we have a better
- * chance of saving the configuration, but a better chance of doing
- * something the user never expected. Let's just warn instead. */
- return write_configuration_file(torrc_fname, get_options());
- }
- return write_configuration_file(get_default_conf_file(), get_options());
+ /* This fails if we can't write to our configuration file.
+ *
+ * If we try falling back to datadirectory or something, we have a better
+ * chance of saving the configuration, but a better chance of doing
+ * something the user never expected. */
+ return write_configuration_file(get_torrc_fname(), get_options());
}
/** Mapping from a unit name to a multiplier for converting that unit into a