snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 1307b6203cd9e963514a3a2808f569f6d0e69a7e
parent f839dc11c9d65fd0f120d4ee648cbf1b695b57e2
Author: default <nobody@localhost>
Date:   Wed, 14 Jun 2023 20:59:00 +0200

Use utimes() to 'touch' the actor file in actor_get().

Diffstat:
Mdata.c | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/data.c b/data.c @@ -1407,13 +1407,9 @@ int actor_get(snac *snac1, const char *actor, xs_dict **data) if (mtime(fn) + max_time < (double) time(NULL)) { /* actor data exists but also stinks */ - FILE *f; - if ((f = fopen(fn, "a")) != NULL) { - /* write a blank at the end to 'touch' the file */ - fwrite(" ", 1, 1, f); - fclose(f); - } + /* touch the file */ + utimes(fn, NULL); status = 205; /* "205: Reset Content" "110: Response Is Stale" */ }