diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2026-03-15 09:26:11 +0100 |
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2026-03-15 09:26:11 +0100 |
| commit | effb1c897ded2ab520661ed3d4e43545bd6af96f (patch) | |
| tree | 4940e74ed15f1b5e8f55b72bf239294bb383f4c2 /FICS/playerdb.c | |
| parent | df5844ffeae9f3f6958c720f5088f4fabb7954cc (diff) | |
write_p_inout: log fprintf() error
Diffstat (limited to 'FICS/playerdb.c')
| -rw-r--r-- | FICS/playerdb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 2c3002a..d8963bb 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -1709,6 +1709,7 @@ write_p_inout(int inout, int p, const char *file, int maxlines) { FILE *fp; int fd; + int ret; if ((fd = open(file, g_open_flags[OPFL_APPEND], g_open_modes)) < 0) { warn("%s: open", __func__); @@ -1722,9 +1723,14 @@ write_p_inout(int inout, int p, const char *file, int maxlines) return; } - fprintf(fp, "%d %s %jd %d %s\n", inout, parray[p].name, - (intmax_t)time(NULL), parray[p].registered, + ret = fprintf(fp, "%d %s %jd %d %s\n", + inout, + parray[p].name, + (intmax_t)time(NULL), + parray[p].registered, dotQuad(parray[p].thisHost)); + if (ret < 0) + warnx("%s: error writing to file", __func__); if (fclose(fp) != 0) warn("%s: error closing file pointer", __func__); |
