aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-09-25 13:24:55 +0800
committerobrien <obrien@FreeBSD.org>2000-09-25 13:24:55 +0800
commit3123b8648e831c11d581fbdc6b408387e6a3a81d (patch)
tree9e1b20b82c48160051a0f436cb22b919f373acc3
parent98c584f600a005bacfe9bb82a76e88ef3c6f3a3c (diff)
downloadfreebsd-ports-gnome-3123b8648e831c11d581fbdc6b408387e6a3a81d.tar.gz
freebsd-ports-gnome-3123b8648e831c11d581fbdc6b408387e6a3a81d.tar.zst
freebsd-ports-gnome-3123b8648e831c11d581fbdc6b408387e6a3a81d.zip
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>
-rw-r--r--devel/ddd/files/patch-LiterateA.C32
-rw-r--r--devel/ddd/files/patch-TTYAgent.C22
2 files changed, 54 insertions, 0 deletions
diff --git a/devel/ddd/files/patch-LiterateA.C b/devel/ddd/files/patch-LiterateA.C
new file mode 100644
index 000000000000..cd25c91cf0d5
--- /dev/null
+++ b/devel/ddd/files/patch-LiterateA.C
@@ -0,0 +1,32 @@
+--- 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;
diff --git a/devel/ddd/files/patch-TTYAgent.C b/devel/ddd/files/patch-TTYAgent.C
new file mode 100644
index 000000000000..2bc5c9083cdb
--- /dev/null
+++ b/devel/ddd/files/patch-TTYAgent.C
@@ -0,0 +1,22 @@
+--- 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
+