0001-ext-io-nonblock-avoid-unnecessary-fcntl-F_SETFL-call.patch

Eric Wong, 03/26/2011 03:38 AM

Download (1.07 KB)

View differences:

ext/io/nonblock/nonblock.c
47 47
static void
48 48
io_nonblock_set(int fd, int f, int nb)
49 49
{
50
    if (nb)
50
    if (nb) {
51
	if ((f & O_NONBLOCK) != 0)
52
	    return;
51 53
	f |= O_NONBLOCK;
52
    else
54
    }
55
    else {
56
	if ((f & O_NONBLOCK) == 0)
57
	    return;
53 58
	f &= ~O_NONBLOCK;
59
    }
54 60
    if (fcntl(fd, F_SETFL, f) == -1)
55 61
	rb_sys_fail(0);
56 62
}
57
-