diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-12-20 10:42:02 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-20 10:42:02 -0500 |
commit | 4b7b305bf0513a9b010ab0fc75060dce8d29206a (patch) | |
tree | 7469b81e23f09598b71ea8c4afd7c1911bbfa061 /src/or/main.c | |
parent | 18543c2c9b7b2a2b23b25b2e64262d60a5c448c5 (diff) | |
download | tor-4b7b305bf0513a9b010ab0fc75060dce8d29206a.tar.gz tor-4b7b305bf0513a9b010ab0fc75060dce8d29206a.zip |
Remove pre-unlink check tor_remove_file; check errno instead.
This removes a time-of-check/time-of-use issue, though in this case
it would probably be harmless.
Diffstat (limited to 'src/or/main.c')
-rw-r--r-- | src/or/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c index e66167fe41..f4050d3a59 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -3401,11 +3401,9 @@ tor_free_all(int postfork) void tor_remove_file(const char *filename) { - if (file_status(filename) == FN_FILE) { - if (tor_unlink(filename) != 0) { - log_warn(LD_FS, "Couldn't unlink %s: %s", + if (tor_unlink(filename) != 0 && errno != ENOENT) { + log_warn(LD_FS, "Couldn't unlink %s: %s", filename, strerror(errno)); - } } } |