[tor-dev] When to exit 0 on error

f55jwk4f at vfemail.net f55jwk4f at vfemail.net
Fri Jun 23 02:49:06 UTC 2017


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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20170623/22f3250d/attachment.sig>


More information about the tor-dev mailing list