aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-03-16 22:42:17 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2025-03-16 22:42:17 +0100
commit45f9ce74d063912e23c9ef49e0c419fc1c5f8c8b (patch)
tree6687ad52189659cf9766e15f6e483de85931191d
parentd67cf79e4d81d098f59103beb2e8460fb9e6ba0e (diff)
Warn about send errors
-rw-r--r--FICS/network.c11
1 files changed, 7 insertions, 4 deletions
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 <arpa/telnet.h>
#include <netinet/in.h>
+#include <err.h>
#include <errno.h>
#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;