diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2026-03-15 22:46:43 +0100 |
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2026-03-15 22:46:43 +0100 |
| commit | 52e1e0e1117bb55b7bf74af3a16a9fd836b82a0f (patch) | |
| tree | 4b88fd433a594a61ebda40fb46c215af3c392b58 /FICS | |
| parent | 631708967047ef1c0e6b113caedcd171d532b9a4 (diff) | |
Log close() errors
Diffstat (limited to 'FICS')
| -rw-r--r-- | FICS/network.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/FICS/network.c b/FICS/network.c index c3f958e..ac20f9c 100644 --- a/FICS/network.c +++ b/FICS/network.c @@ -572,8 +572,12 @@ net_close_connection(int fd) if (con[fd].status == NETSTAT_CONNECTED) net_flush_connection(fd); if (!remConnection(fd)) { - if (fd > 2) - close(fd); + if (fd > 2) { + if (close(fd) != 0) { + warn("%s: error closing file descriptor", + __func__); + } + } } } @@ -627,13 +631,19 @@ ngc2(comstr_t *cs, int timeout) -1) { if (net_addConnection(fd, cli_addr.sin_addr.s_addr) != 0) { (void) fprintf(stderr, "FICS is full. fd = %d.\n", fd); + psend_raw_file(fd, mess_dir, MESS_FULL); - close(fd); + + if (close(fd) != 0) { + warn("%s: error closing file descriptor", + __func__); + } } else { unsigned int fromHost = 0; if (!net_connected_host(fd, &fromHost)) { - close(fd); + warn("%s: error closing file descriptor", + __func__); continue; } |
