mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-16 03:53:01 -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:
parent
2db59b7443
commit
241c53acea
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user