commit 1307b62
default
·
2023-06-14 18:59:00 +0000 UTC
parent f839dc1
Use utimes() to 'touch' the actor file in actor_get().
1 files changed,
+2,
-6
M
data.c
M
data.c
+2,
-6
1@@ -1407,13 +1407,9 @@ int actor_get(snac *snac1, const char *actor, xs_dict **data)
2
3 if (mtime(fn) + max_time < (double) time(NULL)) {
4 /* actor data exists but also stinks */
5- FILE *f;
6
7- if ((f = fopen(fn, "a")) != NULL) {
8- /* write a blank at the end to 'touch' the file */
9- fwrite(" ", 1, 1, f);
10- fclose(f);
11- }
12+ /* touch the file */
13+ utimes(fn, NULL);
14
15 status = 205; /* "205: Reset Content" "110: Response Is Stale" */
16 }