Feature #4528 ยป 0001-ext-io-nonblock-avoid-unnecessary-fcntl-F_SETFL-call.patch
ext/io/nonblock/nonblock.c | ||
---|---|---|
static void
|
||
io_nonblock_set(int fd, int f, int nb)
|
||
{
|
||
if (nb)
|
||
if (nb) {
|
||
if ((f & O_NONBLOCK) != 0)
|
||
return;
|
||
f |= O_NONBLOCK;
|
||
else
|
||
}
|
||
else {
|
||
if ((f & O_NONBLOCK) == 0)
|
||
return;
|
||
f &= ~O_NONBLOCK;
|
||
}
|
||
if (fcntl(fd, F_SETFL, f) == -1)
|
||
rb_sys_fail(0);
|
||
}
|