summaryrefslogtreecommitdiff
path: root/x11/aterm/patches/patch-ae
blob: 20192241526aa730a1e66e5b5ec81ed6b9bae46a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-ae,v 1.1.2.2 2002/08/25 21:22:48 jlam Exp $

--- src/command.c.orig	Thu Sep  6 18:38:07 2001
+++ src/command.c
@@ -1146,6 +1146,11 @@
     num_fds = getdtablesize();
 #endif
 
+#if defined(__NetBSD__)
+    if (num_fds > FD_SETSIZE)
+      num_fds = FD_SETSIZE;
+#endif
+    
 #ifdef META8_OPTION
     meta_char = (Options & Opt_meta8 ? 0x80 : 033);
     if (rs_modifier
@@ -2024,7 +2029,7 @@
 #endif
 
     /* See if we can read from the application */
-	if (FD_ISSET(cmd_fd, &readfds)) {
+	if (retval > 0 && FD_ISSET(cmd_fd, &readfds)) {
 	    unsigned int    count = BUFSIZ;
 
 	    cmdbuf_ptr = cmdbuf_endp = cmdbuf_base;