[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #1523 [Tor Client]: descriptor error
#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs