ext/kgio/read_write.c in kgio-2.8.0 vs ext/kgio/read_write.c in kgio-2.8.0.2.g30c1

- old
+ new

@@ -107,11 +107,11 @@ a->ptr = RSTRING_PTR(a->buf); } 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; } rb_str_set_len(a->buf, 0); @@ -342,11 +342,11 @@ 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; } if (errno == EAGAIN) { @@ -587,10 +587,10 @@ static int writev_check(struct io_args_v *a, long n, const char *msg, int io_wait) { 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; } if (errno == EAGAIN) {