Opened 4 years ago

Closed 4 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:
Severity: Normal Keywords: easy
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


$ /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 4 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by pastly

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

Changed 4 years ago by pastly

Attachment: patch.txt added

comment:2 Changed 4 years ago by pastly

Add changes/ file

comment:3 Changed 4 years ago by nickm

Status: newneeds_review

comment:4 Changed 4 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 4 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 4 years ago by nickm

Resolution: fixed
Status: merge_readyclosed


Note: See TracTickets for help on using tickets.