pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

patch/patch-exp__chan.c fails on my systems. It needs to be wrapped with ifdefs.



Module Name:	pkgsrc-wip
Committed By:	Boyd Lynn Gerber <gerberb%zenez.com@localhost>
Pushed By:	gerberb
Date:		Fri Jun 17 15:43:56 2022 -0600
Changeset:	f6612df07d3e5600766438ce93fcc483501949d7

Modified Files:
	tcl-expect/distinfo
Added Files:
	tcl-expect/patches/patch-exp__chan.c

Log Message:
patch/patch-exp__chan.c fails on my systems.  It needs to be wrapped with ifdefs.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f6612df07d3e5600766438ce93fcc483501949d7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 tcl-expect/distinfo                  |  1 +
 tcl-expect/patches/patch-exp__chan.c | 49 ++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)

diffs:
diff --git a/tcl-expect/distinfo b/tcl-expect/distinfo
index 7531146e8b..f12c50fc58 100644
--- a/tcl-expect/distinfo
+++ b/tcl-expect/distinfo
@@ -5,5 +5,6 @@ SHA512 (expect5.45.4.tar.gz) = a8dc25e8175f67e029e15cbcfca1705165c1c4cb2dd37eaaa
 Size (expect5.45.4.tar.gz) = 632363 bytes
 SHA1 (patch-Makefile.in) = 1efb1bdd0d3a80a8ad2d66aaf1a6b0a344df9c3d
 SHA1 (patch-configure) = be1c1ca1d274c824077988a67005050e4814354f
+SHA1 (patch-exp__chan.c) = 21cd7e8d37cdc465e9523ead81adead38a694c97
 SHA1 (patch-retoglob.c) = 4406f9e5d7622f393e35e7a1f70a700a98d6e981
 SHA1 (patch-tclconfig_tcl.m4) = 8da471800dcc5f110858dd0af36ad5e924232976
diff --git a/tcl-expect/patches/patch-exp__chan.c b/tcl-expect/patches/patch-exp__chan.c
new file mode 100644
index 0000000000..7b2aca2c19
--- /dev/null
+++ b/tcl-expect/patches/patch-exp__chan.c
@@ -0,0 +1,49 @@
+$NetBSD: patch-exp__chan.c,v 1.1 2022/05/15 01:56:24 dholland Exp $
+
+Add hack to work around deadlock situation that occurs on Solaris and
+Linux. See PR 34442.
+
+The problem apparently does not occur on BSD, but it doesn't seem to
+be clear why or whether that's really the case; the description of the
+problem as far as it's understood seems to be portable. So don't
+conditionalize it, as the check should be safe. If this turns out to
+cause problems, we can wrap it in ifdefs.
+
+--- exp_chan.c.orig	2018-02-02 12:15:52.000000000 -0700
++++ exp_chan.c	2022-06-17 15:37:14.620875137 -0600
+@@ -7,6 +7,7 @@
+  */
+ 
+ #include <sys/types.h>
++#include <sys/poll.h>
+ #include <stdio.h>
+ #include <signal.h>
+ #include <errno.h>
+@@ -205,6 +206,8 @@
+     ExpState *esPtr = (ExpState *) instanceData;
+     int bytesRead;			/* How many bytes were actually
+                                          * read from the input device? */
++    struct pollfd fds[1];
++    int pollResult;
+ 
+     *errorCodePtr = 0;
+     
+@@ -215,6 +218,18 @@
+      * nonblocking, the read will never block.
+      */
+ 
++    /* Update: there isn't always, which can lead to hangs. See PR 34442. */
++    fds[0].fd = esPtr->fdin;
++    fds[0].events = POLLIN | POLLERR | POLLHUP | POLLNVAL;
++    pollResult = poll(fds, 1, 0);
++    if (pollResult <= 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);*/
+ 


Home | Main Index | Thread Index | Old Index