I noticed tor sometimes exits 0 on error, specifically in monitor_owning_controller_process in src/or/control.c:
if (owning_controller_process_monitor == NULL) { log_err(LD_BUG, "Couldn't create process-termination monitor for " "owning controller: %s. Exiting.", msg); owning_controller_process_spec = NULL; tor_cleanup(); exit(0); }
and in try_locking in main.c:
r = try_locking(options, 0); if (r<0) { log_err(LD_GENERAL, "No, it's still there. Exiting."); exit(0); }
When to exit 0 on error?