mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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.
This commit is contained in:
+2
-4
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user