diff options
Diffstat (limited to 'src/stweath.c')
-rw-r--r-- | src/stweath.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/stweath.c b/src/stweath.c index e0cd154..62bde59 100644 --- a/src/stweath.c +++ b/src/stweath.c @@ -152,7 +152,12 @@ checkforecast(const char *path) buff = getenv("WEATHERFORCEUPDATE"); if (buff && buff[0] == '1') { force = 1; } - if (stat(path, &st) != 0) { return 1; } + if (access(path, F_OK) != -1) { + if (stat(path, &st) != 0) + die("failed to get modification time"); + } else { + force = 1; + } now = time(NULL); if (now == ((time_t)-1)) { return 1; } |