mirror of
https://git.FreeBSD.org/ports.git
synced 2024-10-31 21:57:12 +00:00
57754ba65d
result of some changes Luoqi Chen made to src/sys/kern/tty_pty.c at revs 1.58 and 1.59, apparently to resolve some sort of race condition. (Search for EAGAIN in that file if you'd like to see). Submitted by: W Gerald Hicks <jhix@mindspring.com>
23 lines
551 B
C
23 lines
551 B
C
--- ddd/TTYAgent.C.orig Thu Aug 19 04:27:58 1999
|
|
+++ ddd/TTYAgent.C Sun Aug 27 02:37:48 2000
|
|
@@ -697,8 +697,19 @@
|
|
}
|
|
else
|
|
{
|
|
+#if !defined(__FreeBSD__)
|
|
if (fcntl(master, F_SETFL, flags | O_NONBLOCK) == -1)
|
|
_raiseIOWarning("cannot set file to non-blocking mode");
|
|
+#else
|
|
+ do {
|
|
+ if(fcntl(master, F_SETFL, flags | O_NONBLOCK) != -1)
|
|
+ break;
|
|
+ else if(errno == EAGAIN)
|
|
+ sleep(1);
|
|
+ else
|
|
+ _raiseIOWarning("cannot set file to non-blocking mode");
|
|
+ } while(errno == EAGAIN);
|
|
+#endif
|
|
}
|
|
#endif
|
|
|