Project

General

Profile

Feature #4528 ยป 0001-ext-io-nonblock-avoid-unnecessary-fcntl-F_SETFL-call.patch

normalperson (Eric Wong), 03/26/2011 03:38 AM

View differences:

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);
}
    (1-1/1)