aboutsummaryrefslogtreecommitdiffstats
path: root/kirc.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);
}