浏览代码

move second stat to a cleaner place

svn:r2890
Roger Dingledine 20 年之前
父节点
当前提交
50c15943a2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/or/routerlist.c

+ 1 - 1
src/or/routerlist.c

@@ -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) {