aboutsummaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-03-31 11:57:56 -0400
committerNick Mathewson <nickm@torproject.org>2014-03-31 11:57:56 -0400
commitc0441cca8b483882f5676b98081f0fe4b52d3ae1 (patch)
tree0f6234deb72feb4de4c80ecbf4b0f0b0e89269f7 /src/or/main.c
parent4ebad0d947cbb74b674468e6601894468629f814 (diff)
parent3118af2d5fca7999a94d73690d83463ddacf9acb (diff)
downloadtor-c0441cca8b483882f5676b98081f0fe4b52d3ae1.tar.gz
tor-c0441cca8b483882f5676b98081f0fe4b52d3ae1.zip
Merge branch 'bug8787_squashed'
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index d1e48ba07b..feca35c440 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -2574,10 +2574,19 @@ tor_cleanup(void)
time_t now = time(NULL);
/* Remove our pid file. We don't care if there was an error when we
* unlink, nothing we could do about it anyways. */
- if (options->PidFile)
- unlink(options->PidFile);
- if (options->ControlPortWriteToFile)
- unlink(options->ControlPortWriteToFile);
+ if (options->PidFile) {
+ if (unlink(options->PidFile) != 0) {
+ log_warn(LD_FS, "Couldn't unlink pid file %s: %s",
+ options->PidFile, strerror(errno));
+ }
+ }
+ if (options->ControlPortWriteToFile) {
+ if (unlink(options->ControlPortWriteToFile) != 0) {
+ log_warn(LD_FS, "Couldn't unlink control port file %s: %s",
+ options->ControlPortWriteToFile,
+ strerror(errno));
+ }
+ }
if (accounting_is_enabled(options))
accounting_record_bandwidth_usage(now, get_or_state());
or_state_mark_dirty(get_or_state(), 0); /* force an immediate save. */