[or-cvs] Remove redundant stat() for reading cached directory, and r...

Roger Dingledine arma at seul.org
Sun Nov 14 09:40:10 UTC 2004


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	routerlist.c 
Log Message:
Remove redundant stat() for reading cached directory, and remove
confusing warn when the cached directory isn't there yet.


Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -d -r1.184 -r1.185
--- routerlist.c	12 Nov 2004 19:39:13 -0000	1.184
+++ routerlist.c	14 Nov 2004 09:40:07 -0000	1.185
@@ -47,17 +47,11 @@
 {
   char filename[512];
   int is_recent;
-  struct stat st;
   char *s;
   tor_assert(get_options()->DataDirectory);
 
   tor_snprintf(filename,sizeof(filename),"%s/cached-directory",
                get_options()->DataDirectory);
-  if (stat(filename, &st)) {
-    log_fn(LOG_WARN, "Unable to check status for '%s': %s", filename,
-           strerror(errno));
-    return 0;
-  }
   s = read_file_to_str(filename,0);
   if (s) {
     log_fn(LOG_INFO, "Loading cached directory from %s", filename);



More information about the tor-commits mailing list