From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpout2.vodafonemail.de (smtpout2.vodafonemail.de [145.253.239.133]) by sourceware.org (Postfix) with ESMTPS id C3731385DC30 for ; Sat, 5 Jun 2021 15:55:43 +0000 (GMT) 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 Received: from smtp.vodafone.de (smtpa03.fra-mediabeam.com [10.2.0.34]) by smtpout2.vodafonemail.de (Postfix) with ESMTP id E1811123679 for ; Sat, 5 Jun 2021 17:55:42 +0200 (CEST) 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= Received: from Gertrud (p54a0c8c7.dip0.t-ipconnect.de [84.160.200.199]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp.vodafone.de (Postfix) with ESMTPSA id 7BC0B1401C9 for ; Sat, 5 Jun 2021 15:55:42 +0000 (UTC) From: Achim Gratz To: cygwin@cygwin.com Subject: Re: [Bug] tmux 3.2-0 References: <87mtsx6six.fsf@Rainer.invalid> <87pmxe1rmk.fsf_-_@Rainer.invalid> <871r9thlw0.fsf@Otto.invalid> <877djebwhi.fsf@Rainer.invalid> <87lf7og9js.fsf@Otto.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 Content-Type: text/plain 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2021 15:55:49 -0000 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