зеркало из https://github.com/github/ruby.git
suppress warnings by parenthesizing unclear expressions
This commit is contained in:
Родитель
7459a32af3
Коммит
9822ebee5b
8
io.c
8
io.c
|
@ -322,7 +322,7 @@ rb_cloexec_open(const char *pathname, int flags, mode_t mode)
|
||||||
|
|
||||||
while ((ret = open(pathname, flags, mode)) == -1) {
|
while ((ret = open(pathname, flags, mode)) == -1) {
|
||||||
int e = errno;
|
int e = errno;
|
||||||
if (e != EAGAIN && e != EWOULDBLOCK) break;
|
if ((e != EAGAIN) && (e != EWOULDBLOCK)) break;
|
||||||
if (retry_count++ >= retry_max_count) break;
|
if (retry_count++ >= retry_max_count) break;
|
||||||
|
|
||||||
sleep(retry_interval);
|
sleep(retry_interval);
|
||||||
|
@ -3082,7 +3082,7 @@ io_getpartial(int argc, VALUE *argv, VALUE io, int no_exception, int nonblock)
|
||||||
int e = errno;
|
int e = errno;
|
||||||
if (!nonblock && fptr_wait_readable(fptr))
|
if (!nonblock && fptr_wait_readable(fptr))
|
||||||
goto again;
|
goto again;
|
||||||
if (nonblock && (e == EWOULDBLOCK || e == EAGAIN)) {
|
if (nonblock && ((e == EWOULDBLOCK) || (e == EAGAIN))) {
|
||||||
if (no_exception)
|
if (no_exception)
|
||||||
return sym_wait_readable;
|
return sym_wait_readable;
|
||||||
else
|
else
|
||||||
|
@ -3218,7 +3218,7 @@ io_read_nonblock(rb_execution_context_t *ec, VALUE io, VALUE length, VALUE str,
|
||||||
n = read_internal_locktmp(str, &iis);
|
n = read_internal_locktmp(str, &iis);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
int e = errno;
|
int e = errno;
|
||||||
if ((e == EWOULDBLOCK || e == EAGAIN)) {
|
if ((e == EWOULDBLOCK) || (e == EAGAIN)) {
|
||||||
if (!ex) return sym_wait_readable;
|
if (!ex) return sym_wait_readable;
|
||||||
rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE,
|
rb_readwrite_syserr_fail(RB_IO_WAIT_READABLE,
|
||||||
e, "read would block");
|
e, "read would block");
|
||||||
|
@ -3260,7 +3260,7 @@ io_write_nonblock(rb_execution_context_t *ec, VALUE io, VALUE str, VALUE ex)
|
||||||
|
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
int e = errno;
|
int e = errno;
|
||||||
if (e == EWOULDBLOCK || e == EAGAIN) {
|
if ((e == EWOULDBLOCK) || (e == EAGAIN)) {
|
||||||
if (!ex) {
|
if (!ex) {
|
||||||
return sym_wait_writable;
|
return sym_wait_writable;
|
||||||
}
|
}
|
||||||
|
|
2
thread.c
2
thread.c
|
@ -1670,7 +1670,7 @@ rb_nogvl(void *(*func)(void *), void *data1,
|
||||||
int saved_errno = 0;
|
int saved_errno = 0;
|
||||||
VALUE ubf_th = Qfalse;
|
VALUE ubf_th = Qfalse;
|
||||||
|
|
||||||
if (ubf == RUBY_UBF_IO || ubf == RUBY_UBF_PROCESS) {
|
if ((ubf == RUBY_UBF_IO) || (ubf == RUBY_UBF_PROCESS)) {
|
||||||
ubf = ubf_select;
|
ubf = ubf_select;
|
||||||
data2 = th;
|
data2 = th;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче