diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-04-30 14:25:25 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-04-30 14:25:25 +0000 |
commit | b05a313a40f50a59f7ea590227a7731abea59829 (patch) | |
tree | be6c2891676e5bfb95f1f04d2894807b075b2835 /Build/source | |
parent | cc7fbde1571aa3cecb79770042c49375b8090374 (diff) |
Change order of execution lines.
git-svn-id: svn://tug.org/texlive/trunk@30186 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/dvipdfmx/src/dpxfile.c | 11 | ||||
-rw-r--r-- | Build/source/texk/xdvipdfmx/src/dpxfile.c | 11 |
2 files changed, 16 insertions, 6 deletions
diff --git a/Build/source/texk/dvipdfmx/src/dpxfile.c b/Build/source/texk/dvipdfmx/src/dpxfile.c index 8aa77d00d20..d6390641ed0 100644 --- a/Build/source/texk/dvipdfmx/src/dpxfile.c +++ b/Build/source/texk/dvipdfmx/src/dpxfile.c @@ -871,16 +871,21 @@ dpx_clear_cache_filter (const struct dirent *ent) { void dpx_delete_old_cache (int life) { - const char *dir = dpx_get_tmpdir(); - char *pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); + const char *dir; + char *pathname; DIR *dp; struct dirent *de; - time_t limit = time(NULL) - life * 60 * 60; + time_t limit; if (life == -2) { keep_cache = -1; return; } + + dir = dpx_get_tmpdir(); + pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); + limit = time(NULL) - life * 60 * 60; + if (life >= 0) keep_cache = 1; if ((dp = opendir(dir)) != NULL) { while((de = readdir(dp)) != NULL) { diff --git a/Build/source/texk/xdvipdfmx/src/dpxfile.c b/Build/source/texk/xdvipdfmx/src/dpxfile.c index b904bea8055..a0b124c722e 100644 --- a/Build/source/texk/xdvipdfmx/src/dpxfile.c +++ b/Build/source/texk/xdvipdfmx/src/dpxfile.c @@ -893,16 +893,21 @@ dpx_clear_cache_filter (const struct dirent *ent) { void dpx_delete_old_cache (int life) { - const char *dir = dpx_get_tmpdir(); - char *pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); + const char *dir; + char *pathname; DIR *dp; struct dirent *de; - time_t limit = time(NULL) - life * 60 * 60; + time_t limit; if (life == -2) { keep_cache = -1; return; } + + dir = dpx_get_tmpdir(); + pathname = NEW(strlen(dir)+1+strlen(PREFIX)+MAX_KEY_LEN*2 + 1, char); + limit = time(NULL) - life * 60 * 60; + if (life >= 0) keep_cache = 1; if ((dp = opendir(dir)) != NULL) { while((de = readdir(dp)) != NULL) { |