summaryrefslogtreecommitdiffstats
path: root/devel/ddd/files/patch-TTYAgent.C
blob: 2bc5c9083cdb16dca6f149a63e8abb763004f705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
 	
OpenPOWER on IntegriCloud