ioall: do not reset file flags when they're already as requested

This was changed on a copy of that file elsewhere, might as well
keep this in sync too.
release2 mm_a2e4f9a8
Vincent Penquerc'h 11 years ago committed by Marek Marczykowski-Górecki
parent 3a39c65e3e
commit a2e4f9a8aa

@ -35,12 +35,16 @@ void perror_wrapper(const char * msg)
void set_nonblock(int fd)
{
int fl = fcntl(fd, F_GETFL, 0);
if (fl & O_NONBLOCK)
return;
fcntl(fd, F_SETFL, fl | O_NONBLOCK);
}
void set_block(int fd)
{
int fl = fcntl(fd, F_GETFL, 0);
if (!(fl & O_NONBLOCK))
return;
fcntl(fd, F_SETFL, fl & ~O_NONBLOCK);
}

Loading…
Cancel
Save