From d5085e3001b0ffc99214af7f127e62d843a87b00 Mon Sep 17 00:00:00 2001 From: Michael Jennings Date: Thu, 3 Jan 2002 17:44:39 +0000 Subject: [PATCH] Thu Jan 3 12:42:41 2002 Michael Jennings (mej) This is better. SVN revision: 5805 --- ChangeLog | 4 ++++ src/command.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e331caa..e05e12b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4460,3 +4460,7 @@ Thu Jan 3 12:38:54 2002 Michael Jennings (mej) Fixed the select() call based on info from Paul W Brannan . Also added check for _POSIX_SAVED_IDS. ---------------------------------------------------------------------- +Thu Jan 3 12:42:41 2002 Michael Jennings (mej) + +This is better. +---------------------------------------------------------------------- diff --git a/src/command.c b/src/command.c index 4a59cb8..2029207 100644 --- a/src/command.c +++ b/src/command.c @@ -2103,7 +2103,7 @@ run_command(char **argv) privileges(IGNORE); ptyfd = get_pty(); - AT_LEAST(num_fds, ptyfd); + AT_LEAST(num_fds, ptyfd + 1); if (ptyfd < 0) return (-1); @@ -2287,9 +2287,9 @@ init_command(char **argv) Xfd = XConnectionNumber(Xdisplay); D_CMD(("Xfd = %d\n", Xfd)); cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; - AT_LEAST(num_fds, Xfd); + AT_LEAST(num_fds, Xfd + 1); if (pipe_fd >= 0) { - AT_LEAST(num_fds, pipe_fd); + AT_LEAST(num_fds, pipe_fd + 1); } if ((cmd_fd = run_command(argv)) < 0) { @@ -2528,7 +2528,7 @@ cmd_getc(void) } else { delay = &value; } - retval = select(num_fds + 1, &readfds, NULL, NULL, delay); + retval = select(num_fds, &readfds, NULL, NULL, delay); /* See if we can read from the application */ if (cmd_fd >= 0 && FD_ISSET(cmd_fd, &readfds)) {