diff options
Diffstat (limited to 'ext/kgio/read_write.c')
-rw-r--r-- | ext/kgio/read_write.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/kgio/read_write.c b/ext/kgio/read_write.c index 4ce3541..f4d658c 100644 --- a/ext/kgio/read_write.c +++ b/ext/kgio/read_write.c @@ -109,7 +109,7 @@ static void prepare_read(struct io_args *a, int argc, VALUE *argv, VALUE io) static int read_check(struct io_args *a, long n, const char *msg, int io_wait) { - if (n == -1) { + if (n < 0) { if (errno == EINTR) { a->fd = my_fileno(a->io); return -1; @@ -344,7 +344,7 @@ static int write_check(struct io_args *a, long n, const char *msg, int io_wait) if (a->len == n) { done: a->buf = Qnil; - } else if (n == -1) { + } else if (n < 0) { if (errno == EINTR) { a->fd = my_fileno(a->io); return -1; @@ -589,7 +589,7 @@ static int writev_check(struct io_args_v *a, long n, const char *msg, int io_wai if (n >= 0) { if (n > 0) a->something_written = 1; return trim_writev_buffer(a, n); - } else if (n == -1) { + } else if (n < 0) { if (errno == EINTR) { a->fd = my_fileno(a->io); return -1; |