From: Alan Curry <pacman@TheWorld.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
continue;
}
if (errno == EWOULDBLOCK) {
- int cpid, off = 0;
+ int cpid, flags;
if (forked) {
(void) close(fd);
(void) signal(SIGTERM, SIG_DFL); /* XXX */
(void) sigsetmask(0);
(void) alarm((u_int)tmout);
- (void) fcntl(fd, O_NONBLOCK, &off);
+ flags = fcntl(fd, F_GETFL);
+ fcntl(flags, F_SETFL, (long) (flags & ~O_NONBLOCK));
continue;
}
/*