[tor-bugs] #25081 [Core Tor/Tor]: use get_uptime() consistently

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jan 30 05:13:46 UTC 2018


#25081: use get_uptime() consistently
------------------------------+--------------------------------
     Reporter:  arma          |      Owner:  (none)
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.4.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:  easy
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 We have this nice function get_uptime() that shields the global variable
 {{{stats_n_seconds_working}}} from the rest of the Tor files.

 But then we undermine that by saying
 {{{
 extern long stats_n_seconds_working;
 }}}
 in main.h and we just start using that variable directly all over.

 There are a few lonely users of get_uptime().

 We should move everybody over to using get_uptime, and get rid of the
 scary extern.

 (Also check out how we're *writing* to the extern variable, in
 hibernate.c. There's no way that could confuse anybody down the road!)

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/25081>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list