[tor-bugs] #1523 [Tor Client]: descriptor error

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sat Jan 8 10:56:13 UTC 2011


#1523: descriptor error
------------------------+---------------------------------------------------
 Reporter:  gigs440     |       Owner:                    
     Type:  defect      |      Status:  new               
 Priority:  minor       |   Milestone:  Tor: 0.2.2.x-final
Component:  Tor Client  |     Version:                    
 Keywords:              |      Parent:                    
------------------------+---------------------------------------------------

Comment(by cypherpunks):

 Another idea for failed replace_file() calls:
 {{{
 --- routerlist.c.origin Mon Jan  3 22:25:30 2011
 +++ routerlist.c        Sat Jan  8 10:49:06 2011
 @@ -747,9 +747,24 @@
      store->mmap = NULL;
    }

 +  /* Ugly idea */
 +  if (unlink(fname)) {
 +    log_warn(LD_FS, "Error deleting old router store: %s." ,
 strerror(errno));
 +    goto done;
 +  }
 +
    if (replace_file(fname_tmp, fname)<0) {
 -    log_warn(LD_FS, "Error replacing old router store: %s",
 strerror(errno));
 -    goto done;
 +    char *err_replace = tor_strdup(strerror(errno));
 +    if (file_status(fname) == FN_FILE) {
 +      log_info(LD_FS, "Error replacing old router store: %s. "
 +                      "But seems like %s is valid",
 +                       strerror(errno), fname);
 +      tor_free(err_replace);
 +    } else {
 +      log_warn(LD_FS, "Error replacing old router store: %s." ,
 err_replace);
 +      tor_free(err_replace);
 +      goto done;
 +    }
    }

    errno = 0;
 }}}

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


More information about the tor-bugs mailing list