]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
move second stat to a cleaner place
authorRoger Dingledine <arma@torproject.org>
Mon, 15 Nov 2004 09:22:01 +0000 (09:22 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 15 Nov 2004 09:22:01 +0000 (09:22 +0000)
svn:r2890

src/or/routerlist.c

index a7fa3e0669200d0fb5689dd5e0ec4578e0dd2c72..bb29e3917a369b042da685e0813f5e7b1de7ab80 100644 (file)
@@ -53,9 +53,9 @@ int router_reload_router_list(void)
 
   tor_snprintf(filename,sizeof(filename),"%s/cached-directory",
                get_options()->DataDirectory);
-  stat(filename, &st); /* ignore return value; if s is true below, it worked */
   s = read_file_to_str(filename,0);
   if (s) {
+    stat(filename, &st); /* if s is true, stat probably worked */
     log_fn(LOG_INFO, "Loading cached directory from %s", filename);
     is_recent = st.st_mtime > time(NULL) - 60*15;
     if (router_load_routerlist_from_directory(s, NULL, is_recent) < 0) {