aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorPaul Eggert2014-06-02 17:44:30 -0700
committerPaul Eggert2014-06-02 17:44:30 -0700
commit827a3c3d8e53eabefcaf81b2944dad5e79e8031a (patch)
tree25cf8e279251d5d088b80b19a1d1ffce7ee1c24c /src/process.c
parentcf3c1e2344f8ce18a8bfcab3396a28887c9764aa (diff)
downloademacs-827a3c3d8e53eabefcaf81b2944dad5e79e8031a.tar.gz
emacs-827a3c3d8e53eabefcaf81b2944dad5e79e8031a.zip
* process.c (wait_reading_process_output): Omit incorrect test
of p->infd against zero. Add easserts for infd having a plausible value.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/process.c b/src/process.c
index 561aefc6c9f..e77dcb2b41e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4630,12 +4630,13 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4630 { 4630 {
4631 struct Lisp_Process *p = 4631 struct Lisp_Process *p =
4632 XPROCESS (chan_process[channel]); 4632 XPROCESS (chan_process[channel]);
4633 if (p && p->gnutls_p && p->gnutls_state && p->infd 4633 if (p && p->gnutls_p && p->gnutls_state
4634 && ((emacs_gnutls_record_check_pending 4634 && ((emacs_gnutls_record_check_pending
4635 (p->gnutls_state)) 4635 (p->gnutls_state))
4636 > 0)) 4636 > 0))
4637 { 4637 {
4638 nfds++; 4638 nfds++;
4639 eassert (p->infd == channel);
4639 FD_SET (p->infd, &Available); 4640 FD_SET (p->infd, &Available);
4640 } 4641 }
4641 } 4642 }
@@ -4651,6 +4652,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
4651 > 0)) 4652 > 0))
4652 { 4653 {
4653 nfds = 1; 4654 nfds = 1;
4655 eassert (0 <= wait_proc->infd
4656 && wait_proc->infd < FD_SETSIZE);
4654 /* Set to Available. */ 4657 /* Set to Available. */
4655 FD_SET (wait_proc->infd, &Available); 4658 FD_SET (wait_proc->infd, &Available);
4656 } 4659 }