From 45f9ce74d063912e23c9ef49e0c419fc1c5f8c8b Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 16 Mar 2025 22:42:17 +0100 Subject: Warn about send errors --- FICS/network.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'FICS') diff --git a/FICS/network.c b/FICS/network.c index fd8732e..ab8c4e0 100644 --- a/FICS/network.c +++ b/FICS/network.c @@ -10,6 +10,7 @@ #include #include +#include #include #include "common.h" @@ -434,11 +435,13 @@ readline2(comstr_t *cs, int who) break; case 4: // got IAC DO if (*s == TELOPT_TM) { - send(fd, (char *)will_tm, - sizeof will_tm - 1, 0); + if (send(fd, (char *)will_tm, + sizeof will_tm - 1, 0) == -1) + warn("%s: cannot send", __func__); } else if (*s == TELOPT_SGA) { - send(fd, (char *)will_sga, - sizeof will_sga - 1, 0); + if (send(fd, (char *)will_sga, + sizeof will_sga - 1, 0) == -1) + warn("%s: cannot send", __func__); } state = 2; break; -- cgit v1.2.3