From: Paul Eggert Date: Tue, 3 Jun 2014 00:44:30 +0000 (-0700) Subject: * process.c (wait_reading_process_output): Omit incorrect test X-Git-Tag: emacs-25.0.90~2612^2~709^2~796 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=827a3c3d8e53eabefcaf81b2944dad5e79e8031a;p=emacs.git * process.c (wait_reading_process_output): Omit incorrect test of p->infd against zero. Add easserts for infd having a plausible value. --- diff --git a/src/ChangeLog b/src/ChangeLog index f0c0c973be8..ded001073ae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-06-03 Paul Eggert + + * process.c (wait_reading_process_output): Omit incorrect test + of p->infd against zero. Add easserts for infd having a plausible + value. + 2014-06-02 Dmitry Antipov Adjust to match recent lwlib changes. 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, { struct Lisp_Process *p = XPROCESS (chan_process[channel]); - if (p && p->gnutls_p && p->gnutls_state && p->infd + if (p && p->gnutls_p && p->gnutls_state && ((emacs_gnutls_record_check_pending (p->gnutls_state)) > 0)) { nfds++; + eassert (p->infd == channel); FD_SET (p->infd, &Available); } } @@ -4651,6 +4652,8 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd, > 0)) { nfds = 1; + eassert (0 <= wait_proc->infd + && wait_proc->infd < FD_SETSIZE); /* Set to Available. */ FD_SET (wait_proc->infd, &Available); }