qt terminal for gnuplot on cygwin workaround)
Mark Geisert
mark@maxrnd.com
Mon Jan 10 06:35:46 GMT 2022
Hi Tatsuro,
Tatsuro MATSUOKA wrote:
> A workaround for qt enables qt termnal on Cygwin is shown by Enrico Forestieri
> https://sourceforge.net/p/gnuplot/mailman/gnuplot-beta/thread/16092.81463.qm@web103110.mail.kks.yahoo.co.jp/
>> --- a/qtbase-everywhere-src-5.10.1/src/network/socket/qlocalsocket_unix.cpp
> +++ b/qtbase-everywhere-src-5.10.1/src/network/socket/qlocalsocket_unix.cpp
> @@ -239,7 +239,7 @@ void QLocalSocket::connectToServer(OpenM
> }
>> // create the socket
> - if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM, 0,
> O_NONBLOCK))) {
> + if (-1 == (d->connectingSocket = qt_safe_socket(PF_UNIX, SOCK_STREAM,
> 0))) {
> d->errorOccurred(UnsupportedSocketOperationError,
>> QLatin1String("QLocalSocket::connectToServer"));
> return;
>> I myself generate library libQt5Network as libQt5Network-gnuplot and used gnuplot build.
> I dp not know that the modification avove is valid but enables me to use qt terminal on cygwin.
Apologies for the late response. As quoted above, the patch changes the number of
args passed to qt_safe_socket() so maybe that's incorrect?
In any case I think the intent was to change the call from nonblocking to
blocking. That seems likely to interfere with other socket or terminal I/O that
may be expected asynchronously.
I investigated the gnuplot vs Qterm problem several years ago and found the root
cause: deep within the Qt networking code a call to connect() wasn't expecting the
error EINPROGRESS to be returned. POSIX decrees this error when a nonblocking
connect() cannot immediately be completed. I opened a Qt BUG for this, but the Qt
folks declined to fix. I then tried making a Cygwin-only patch but was stymied by
my inability to build Qt itself due to bit rot.
If we have or can get a recent Qt build completed, I can supply a patch to fix the
issue.
..mark
More information about the Cygwin
mailing list