diff options
author | Andrea Shepard <andrea@torproject.org> | 2014-03-18 17:52:31 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-03-31 11:27:08 -0400 |
commit | abdf1878a3f8fe366d8bb7f649127880bdbdf82d (patch) | |
tree | 047bb6044119bb27a6c19f2452409063ca9173e7 /src/or/hibernate.c | |
parent | df076eccfaa680ee08b8ae866690d9a2a8ba5555 (diff) | |
download | tor-abdf1878a3f8fe366d8bb7f649127880bdbdf82d.tar.gz tor-abdf1878a3f8fe366d8bb7f649127880bdbdf82d.zip |
Always check returns from unlink()
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r-- | src/or/hibernate.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c index 607dec8cd5..bbda8424f6 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -648,7 +648,15 @@ read_bandwidth_usage(void) { char *fname = get_datadir_fname("bw_accounting"); - unlink(fname); + int res; + + res = unlink(fname); + if (res != 0) { + log_warn(LD_FS, + "Failed to unlink %s: %s", + fname, strerror(errno)); + } + tor_free(fname); } |