Opened 3 years ago

Closed 3 years ago

#19964 closed defect (fixed)

warns on startup that it cannot remove bw_accounting

Reported by: weasel Owned by:
Priority: Medium Milestone: Tor: 0.2.9.x-final
Component: Core Tor/Tor Version: Tor: 0.2.9.1-alpha
Severity: Normal Keywords: easy
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

$ /usr/bin/tor --OrPort 19050 --Publish 0 --AccountingMax '200 GB' --SocksPort 0 --Log 'warn stdout'
[..]
Aug 23 20:24:26.000 [warn] Failed to unlink /home/weasel/.tor/bw_accounting: No such file or directory

It shouldn't warn when the file doesn't exist to begin with.

Child Tickets

Attachments (1)

patch.txt (599 bytes) - added by pastly 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 3 years ago by pastly

Added patch.txt which checks that errno != ENOENT, file/directory not found.

Changed 3 years ago by pastly

Attachment: patch.txt added

comment:2 Changed 3 years ago by pastly

Add changes/ file

comment:3 Changed 3 years ago by nickm

Status: newneeds_review

comment:4 Changed 3 years ago by teor

Status: needs_reviewmerge_ready

Looks good to me.

As an alternative, we could use file_status() to check the file exists before unlinking it. But that seems like more complexity than we need here.

comment:5 Changed 3 years ago by nickm

Also, check-then-unlink will make analysis tools warn us about race conditions, whereas this approach won't.

comment:6 Changed 3 years ago by nickm

Resolution: fixed
Status: merge_readyclosed

Merged!

Note: See TracTickets for help on using tickets.