[tor-bugs] #8787 [Tor]: Check return values for more unix functions

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Mar 20 03:09:51 UTC 2014

#8787: Check return values for more unix functions
     Reporter:  nickm   |      Owner:
         Type:  defect  |     Status:  needs_review
     Priority:  normal  |  Milestone:  Tor: 0.2.5.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:  tor-client 025-triaged
Actual Points:          |  Parent ID:
       Points:          |

Comment (by nickm):

 35aca52324d835eb1895cb769130a00cde067b3f -- I think 'res' should be block-
 local to lower the chances of our confusing it with 'r'. Also, should we
 really return -1 when unlink fails in finish_writing_to_file_impl?

 f0bc9874fd28a2ff0f839a16ead514be51cfde25 -- It's scary to have
 tor_munmap_file() fail but to keep the mapped thing around.  In fact, why
 return -1?

 1fb049d2433dfed207d4655114421bbdef9a2e6d -- Our convention on
 FOO_free(NULL) is to treat it as a no-op.  Why not have the same
 convention for tor_munmap_file() ?

 -- Also, You can check the return value of UnmapViewOfFile to see whether
 it succeeded: http://msdn.microsoft.com/en-

Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8787#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online

More information about the tor-bugs mailing list