1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-27 21:29:02 +00:00
freebsd-ports/devel/ddd/files/patch-TTYAgent.C
David E. O'Brien 57754ba65d Fix an annoying (but apparently benign) error dialog that seems to be a
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>
2000-09-25 05:24:55 +00:00

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