diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -264,9 +264,11 @@ rb_cloexec_open(const char *pathname, int flags, mode_t mode) if (ret == -1) return -1; if (ret <= 2 || o_cloexec_state == 0) { rb_maygvl_fd_fix_cloexec(ret); - } else if (o_cloexec_state > 0) { + } + else if (o_cloexec_state > 0) { return ret; - } else { + } + else { o_cloexec_state = rb_fix_detect_o_cloexec(ret); } return ret; @@ -1074,10 +1076,11 @@ io_flush_buffer_async2(VALUE arg) /* pending async interrupt is there. */ errno = EAGAIN; return -1; - } else if (ret == 1) { + } + else if (ret == 1) { return 0; - } else - return ret; + } + return ret; } static inline int @@ -2716,7 +2719,8 @@ io_write_nonblock(VALUE io, VALUE str, int no_exception) if (errno == EWOULDBLOCK || errno == EAGAIN) { if (no_exception) { return ID2SYM(rb_intern("wait_writable")); - } else { + } + else { rb_readwrite_sys_fail(RB_IO_WAIT_WRITABLE, "write would block"); } } |