]> git.eshelyaron.com Git - emacs.git/commitdiff
* process.c (wait_reading_process_output): Omit incorrect test
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Jun 2014 00:44:30 +0000 (17:44 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Jun 2014 00:44:30 +0000 (17:44 -0700)
of p->infd against zero.  Add easserts for infd having a plausible
value.

src/ChangeLog
src/process.c

index f0c0c973be8b90d4331bc8a6a01d008df864af08..ded001073ae1fedb22e3291881b47e4c30b01e63 100644 (file)
@@ -1,3 +1,9 @@
+2014-06-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * 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  <dmantipov@yandex.ru>
 
        Adjust to match recent lwlib changes.
index 561aefc6c9f5c14ef83e6fd8004d4293b157f943..e77dcb2b41e1d3426f5f74314fdbf499796a97e5 100644 (file)
@@ -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);
                    }