Opened 2 years ago

Closed 2 years ago

#22720 closed defect (fixed)

Don't exit(0) on error: exit(1) instead

Reported by: nickm Owned by:
Priority: Medium Milestone: Tor: 0.3.1.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-relay exit error-code easy
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


per recent tor-talk thread, there are several places in our code where we exit(0) on an error, and we should exit(1) instead.

When fixing this, it's a good idea to check every exit(0) to see whether it's an error or an expected exit condition.

Child Tickets

Attachments (1)

tic22720.patch (1.4 KB) - added by huyvq 2 years ago.

Download all attachments as: .zip

Change History (6)

Changed 2 years ago by huyvq

Attachment: tic22720.patch added

comment:1 Changed 2 years ago by huyvq

I checked every exit(0) and changed exit(0) following log_err() to exit(1).

comment:2 Changed 2 years ago by nickm

Status: newneeds_review

comment:3 Changed 2 years ago by dgoulet

Status: needs_reviewmerge_ready

I did a pass at the 17 places where we exit(0) and the proposed patch does fixes the 3 callsites that are errors.


comment:4 Changed 2 years ago by nickm

Merged to 0.3.1 and forward

comment:5 Changed 2 years ago by nickm

Resolution: fixed
Status: merge_readyclosed
Note: See TracTickets for help on using tickets.