We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cee5c0 commit d95e2a7Copy full SHA for d95e2a7
kirc.c
@@ -77,10 +77,11 @@ raw(char *fmt, ...) {
77
78
if (verb) printf("<< %s", cmd_str);
79
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
- }
+
+ ssize_t rc;
+ do {
+ rc = write(conn, cmd_str, strlen(cmd_str));
84
+ } while ((rc < 0) && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
85
86
free(cmd_str);
87
}
0 commit comments