delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/06/05/11:56:28

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C3731385DC30
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=nexgo.de
Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nexgo.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nexgo.de;
s=vfde-smtpout-mb-15sep; t=1622908542;
bh=7KhJTDgkerYJbxHCmumsZfPgGy7xcx5WgOSucnSWb+M=;
h=From:To:Subject:References:Date:In-Reply-To;
b=T+mQKdw0KSUwh7wSnXZFg/PBUySVl6n+dsZZeD4mzGADVdkw9fDm5v85rhaLkClSG
qGYkZY7HCa0sC9JwK66tmlDCGtuPcAfcvSAuVOU1hDJMZrRX8wuUBOIvwFJXrAFvLs
UWBjPet2eRN3rCmK7bSDFRMEMKCKSWeQJRgUsfYg=
From: Achim Gratz <Stromeko AT nexgo DOT de>
To: cygwin AT cygwin DOT com
Subject: Re: [Bug] tmux 3.2-0
References: <announce.CAALQ5rm2xisVPE8WqJOWVxs4o9Qr0Cpcnqx=VybTeyFD005kxA AT mail DOT gmail DOT com>
<87mtsx6six DOT fsf AT Rainer DOT invalid> <87pmxe1rmk DOT fsf_-_ AT Rainer DOT invalid>
<CAALQ5r=xF_y9cgMn2gRWR4tmvK4TQN-NHYSVx1CepW8NVp=yHg AT mail DOT gmail DOT com>
<871r9thlw0 DOT fsf AT Otto DOT invalid>
<CAALQ5r=Zx3krUx_qw-c8-_4aEsEtS63kahCZo1GzfwXpDz2B0w AT mail DOT gmail DOT com>
<877djebwhi DOT fsf AT Rainer DOT invalid>
<CAALQ5r=kZ=bJV9S7fMzNH+SSQQXwKAfvxyd17gMY_TW3Jo3tAQ AT mail DOT gmail DOT com>
<CAALQ5r=3ih5kp_QQK8OPm-qE835yU88RJ2DsmTutembLUgTEZg AT mail DOT gmail DOT com>
<87lf7og9js DOT fsf AT Otto DOT invalid>
Date: Sat, 05 Jun 2021 17:55:42 +0200
In-Reply-To: <87lf7og9js.fsf@Otto.invalid> (ASSI's message of "Sat, 05 Jun
2021 07:33:27 +0200")
Message-ID: <87zgw4s3up.fsf@Rainer.invalid>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
X-purgate-type: clean
X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de
X-purgate: This mail is considered clean (visit http://www.eleven.de for
further information)
X-purgate: clean
X-purgate-size: 1940
X-purgate-ID: 155817::1622908542-00000810-24C0AB3D/0/0
X-Spam-Status: No, score=-3032.4 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW,
RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS,
TXREP autolearn=ham autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

ASSI writes:
> It _might_ be possible for this particular case that one could open
> /proc/${clientpid}/fd/1 and have it do the right thing.  If so, then the
> call just above that clobbers stdin with the ttyname would probably be
> better off as /proc/${clientpid}/fd/0.

To paraphrase Douglas N. Adams:  If you try that, it will do something that's almost,
but not quite, entirely unlike what you wanted it to do.

--8<---------------cut here---------------start------------->8---
--- origsrc/tmux-3.2/configure.ac       2021-04-13 09:37:43.000000000 +0200
+++ src/tmux-3.2/configure.ac   2021-06-05 11:31:12.985505400 +0200
@@ -1,6 +1,6 @@
 # configure.ac
 
-AC_INIT([tmux], 3.2)
+AC_INIT([tmux], 3.2p1)
 AC_PREREQ([2.60])
 
 AC_CONFIG_AUX_DIR(etc)
--- origsrc/tmux-3.2/server-client.c    2021-06-05 09:29:04.102404100 +0200
+++ src/tmux-3.2/server-client.c        2021-06-05 11:36:50.162975600 +0200
@@ -2269,7 +2269,19 @@ server_client_dispatch_identify(struct c
        log_debug("client %p name is %s", c, c->name);
 
 #ifdef __CYGWIN__
        c->fd = open(c->ttyname, O_RDWR|O_NOCTTY);
+       /* nope
+       c->out_fd = dup(c->fd);
+        */
+       if (0 < c->pid) {
+         /* UNIX domain sockets can't be used to transfer open fd on Cygwin yet */
+         char *fdnstr = NULL;
+         int fdnsz = asprintf(&fdnstr, "/proc/%u/fd/1", c->pid);
+         if (0 < fdnsz) {
+           c->out_fd = open(fdnstr, O_RDWR|O_NOCTTY);
+           free(fdnstr);
+         }
+       }
 #endif
 
        if (c->flags & CLIENT_CONTROL)
--8<---------------cut here---------------end--------------->8---

It actually runs half the tests that way, but the other half hangs up
for unknown reasons.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Samples for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldSamplesExtra

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019