aboutsummaryrefslogtreecommitdiffstats
path: root/kirc.c
diff options
context:
space:
mode:
authormcpcpc <michaelczigler@icloud.com>2020-09-17 11:15:57 -0400
committermcpcpc <michaelczigler@icloud.com>2020-09-17 11:15:57 -0400
commitd95e2a74ed7eebd2f76e2ad366f92f2cbedcd296 (patch)
treecdc1bd7be28df58d7b2ebe91808ee374490cb545 /kirc.c
parentadd error checking for malloc() (diff)
downloadkirc-d95e2a74ed7eebd2f76e2ad366f92f2cbedcd296.tar.gz
kirc-d95e2a74ed7eebd2f76e2ad366f92f2cbedcd296.tar.bz2
kirc-d95e2a74ed7eebd2f76e2ad366f92f2cbedcd296.tar.xz
kirc-d95e2a74ed7eebd2f76e2ad366f92f2cbedcd296.tar.zst
kirc-d95e2a74ed7eebd2f76e2ad366f92f2cbedcd296.zip
retest write
Diffstat (limited to 'kirc.c')
-rw-r--r--kirc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kirc.c b/kirc.c
index 6fe1b8a..917ba9c 100644
--- a/kirc.c
+++ b/kirc.c
@@ -77,10 +77,11 @@ raw(char *fmt, ...) {
if (verb) printf("<< %s", cmd_str);
if (olog) log_append(cmd_str, olog);
- if (write(conn, cmd_str, strlen(cmd_str)) < 0) {
- perror("write");
- exit(EXIT_FAILURE);
- }
+
+ ssize_t rc;
+ do {
+ rc = write(conn, cmd_str, strlen(cmd_str));
+ } while ((rc < 0) && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
free(cmd_str);
}