freebsd-ports/devel/ddd/files/patch-LiterateA.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

32 lines
967 B
C

--- ddd/LiterateA.C.orig Thu Aug 19 04:27:40 1999
+++ ddd/LiterateA.C Sun Aug 27 02:37:48 2000
@@ -220,8 +220,12 @@
int flags = fcntl(fileno(fp), F_GETFL, 0);
if (flags == -1)
_raiseIOWarning("cannot get file descriptor status flags");
- if (fcntl(fileno(fp), F_SETFL, flags | O_NONBLOCK) == -1)
- _raiseIOWarning("cannot set file to non-blocking mode");
+ if (fcntl(fileno(fp), F_SETFL, flags | O_NONBLOCK) == -1) {
+#if defined(__FreeBSD__)
+ if(errno != EAGAIN)
+#endif
+ _raiseIOWarning("cannot set file to non-blocking mode");
+ }
#endif
// Read stuff
@@ -255,8 +259,12 @@
#if HAVE_FCNTL && defined(F_SETFL)
// Reset file state
- if (fcntl(fileno(fp), F_SETFL, flags) == -1)
- _raiseIOWarning("cannot restore file mode");
+ if (fcntl(fileno(fp), F_SETFL, flags) == -1) {
+#if defined(__FreeBSD__)
+ if(errno != EAGAIN)
+#endif
+ _raiseIOWarning("cannot restore file mode");
+ }
#endif
return nitems;