X-Git-Url: http://git.thejh.net/?p=libjh.git;a=blobdiff_plain;f=io.c;h=17ea4d675b04fc709e18738a3e2ec0faf5a47130;hp=dd0d531ed75d97a872962d250ba5ede7bbd781c0;hb=68baa08af4f48a619aaac76de0010c68cd2fe1e4;hpb=00099dea61e576c7803198a2656b5e5eed12ab8a diff --git a/io.c b/io.c index dd0d531..17ea4d6 100644 --- a/io.c +++ b/io.c @@ -42,7 +42,8 @@ PUBLIC_FN ssize_t read_nointr(int fd, void *buf, size_t count, int *last_res) { // - -1: error // - 0: stream ended // - 1: no problems occured -PUBLIC_FN ssize_t write_nointr(int fd, void *buf, size_t count, int *last_res) { +PUBLIC_FN ssize_t write_nointr(int fd, void *buf, ssize_t count, int *last_res) { + if (count == -1) count = strlen(buf); errno = 0; size_t done = 0; while (done < count) {