[rancid] expect-hack1 not applied to patched version of expect-5.4.3 on the FTP site?

Matthew J Wilson mwilson at northwestern.edu
Tue Aug 28 19:17:53 UTC 2012


On 8/28/12 1:21 PM, "heasley" <heas at shrubbery.net> wrote:
>thats the virgin, iirc,
>
>ftp://ftp.shrubbery.net/pub/rancid/expect-5.43.0_hack.tar.bz2


That tarball (when I download it anyway) has expect-hack2 applied to it
for solaris, not expect-hack1 for linux (diff -u output appended at the
bottom of this email).

When I look at the tarballs from the FTP site:
expect-5.40.1.tar.gz       - has linux expect-hack1 applied
expect-5.40.1_hack2.tar.gz - has solaris expect-hack2 applied
expect-5.43.0.tar.bz2      - vanilla: no hack patch applied
expect-5.43.0_hack.tar.bz2 - has solaris expect-hack2 applied

I don't see an expect-5.43 tarball on the FTP site that has the linux
expect-hack1 applied to it.

Thanks for taking a look at this.
Matt



$ diff -u expect-5.43/exp_chan.c.orig expect-5.43/exp_chan.c
--- expect-5.43/exp_chan.c.orig	2005-02-07 20:01:20.000000000 -0600
+++ expect-5.43/exp_chan.c	2010-11-12 15:10:44.000000000 -0600
@@ -12,6 +12,7 @@
 #include <errno.h>
 #include <ctype.h>	/* for isspace */
 #include <time.h>	/* for time(3) */
+#include <poll.h>
 
 #include "expect_cf.h"
 
@@ -190,6 +191,7 @@
     ExpState *esPtr = (ExpState *) instanceData;
     int bytesRead;			/* How many bytes were actually
                                          * read from the input device? */
+struct pollfd fds[1];
 
     *errorCodePtr = 0;
     
@@ -199,6 +201,16 @@
      * possible, if the channel is in blocking mode. If the channel is
      * nonblocking, the read will never block.
      */
+fds[0].fd = esPtr->fdin;
+fds[0].events = POLLIN | POLLERR | POLLHUP | POLLNVAL;
+bytesRead = poll(fds, 1, 0);
+if (bytesRead <= 0) {
+       *errorCodePtr = EWOULDBLOCK;
+       return(-1);
+} else if (fds[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
+       *errorCodePtr = EBADF;
+       return(-1);
+}
 
     bytesRead = read(esPtr->fdin, buf, (size_t) toRead);
     /*printf("ExpInputProc: read(%d,,) = %d\r\n",esPtr->fdin,bytesRead);*/




More information about the Rancid-discuss mailing list