summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-08-26 00:58:18 +0300
committerawy <awy@awy.one>2025-08-26 00:58:18 +0300
commit82dbadd9a22a4f917f6110dd5f9dfcad7f1ec1f2 (patch)
treeffb3eee5bc77a98c2325ce8bf6bf2a939bb9adaf
parent013ac8d3a8e630a389242a527bcc4d140fba104a (diff)
stweath: fix
-rw-r--r--src/stweath.c7
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; }