Skip to content

Commit d95e2a7

Browse files
committed
retest write
1 parent 3cee5c0 commit d95e2a7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

kirc.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ raw(char *fmt, ...) {
7777

7878
if (verb) printf("<< %s", cmd_str);
7979
if (olog) log_append(cmd_str, olog);
80-
if (write(conn, cmd_str, strlen(cmd_str)) < 0) {
81-
perror("write");
82-
exit(EXIT_FAILURE);
83-
}
80+
81+
ssize_t rc;
82+
do {
83+
rc = write(conn, cmd_str, strlen(cmd_str));
84+
} while ((rc < 0) && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
8485

8586
free(cmd_str);
8687
}

0 commit comments

Comments
 (0)