diff options
| author | 2023-06-14 20:59:00 +0200 | |
|---|---|---|
| committer | 2023-06-14 20:59:00 +0200 | |
| commit | 1307b6203cd9e963514a3a2808f569f6d0e69a7e (patch) | |
| tree | 44aa3cde5027e3d5199fa556ab20a3a08bd56b52 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-1307b6203cd9e963514a3a2808f569f6d0e69a7e.tar.gz snac2-1307b6203cd9e963514a3a2808f569f6d0e69a7e.tar.xz snac2-1307b6203cd9e963514a3a2808f569f6d0e69a7e.zip | |
Use utimes() to 'touch' the actor file in actor_get().
| -rw-r--r-- | data.c | 8 |
1 files changed, 2 insertions, 6 deletions
| @@ -1407,13 +1407,9 @@ int actor_get(snac *snac1, const char *actor, xs_dict **data) | |||
| 1407 | 1407 | ||
| 1408 | if (mtime(fn) + max_time < (double) time(NULL)) { | 1408 | if (mtime(fn) + max_time < (double) time(NULL)) { |
| 1409 | /* actor data exists but also stinks */ | 1409 | /* actor data exists but also stinks */ |
| 1410 | FILE *f; | ||
| 1411 | 1410 | ||
| 1412 | if ((f = fopen(fn, "a")) != NULL) { | 1411 | /* touch the file */ |
| 1413 | /* write a blank at the end to 'touch' the file */ | 1412 | utimes(fn, NULL); |
| 1414 | fwrite(" ", 1, 1, f); | ||
| 1415 | fclose(f); | ||
| 1416 | } | ||
| 1417 | 1413 | ||
| 1418 | status = 205; /* "205: Reset Content" "110: Response Is Stale" */ | 1414 | status = 205; /* "205: Reset Content" "110: Response Is Stale" */ |
| 1419 | } | 1415 | } |