1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-16 12:03:03 -05:00

As far as I can see (at least in NetBSD) O_NONBLOCK and FIONBIO are equivalent,

except that O_NONBLOCK is standardised and FIONBIO isn't.  In consequence,
replace our only use of FIONBIO with O_NONBLOCK.

Inspired by Jonathan H N Chin, who had problems with this on Solaris.

[originally from svn r7753]
This commit is contained in:
Ben Harris 2007-10-02 21:07:52 +00:00
parent 2db59b7443
commit 241c53acea

View File

@ -360,8 +360,10 @@ static void pty_open_master(Pty pty)
/* /*
* Set the pty master into non-blocking mode. * Set the pty master into non-blocking mode.
*/ */
int i = 1; int fl;
ioctl(pty->master_fd, FIONBIO, &i); fl = fcntl(pty->master_fd, F_GETFL);
if (fl != -1 && !(fl & O_NONBLOCK))
fcntl(pty->master_fd, F_SETFL, fl | O_NONBLOCK);
} }
if (!ptys_by_fd) if (!ptys_by_fd)