public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: cygwin@cygwin.com
Subject: Re: [Bug] tmux 3.2-0
Date: Sat, 05 Jun 2021 17:55:42 +0200	[thread overview]
Message-ID: <87zgw4s3up.fsf@Rainer.invalid> (raw)
In-Reply-To: <87lf7og9js.fsf@Otto.invalid> (ASSI's message of "Sat, 05 Jun 2021 07:33:27 +0200")

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

      reply	other threads:[~2021-06-05 15:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06  4:54 [ANNOUNCEMENT] " Michael Wild via Cygwin-announce
2021-05-14 19:10 ` Achim Gratz
2021-05-25 20:32   ` [Bug] " Achim Gratz
2021-05-26  6:34     ` Michael Wild
2021-05-26  9:42       ` ASSI
2021-05-31 15:37         ` Michael Wild
2021-05-31 18:15           ` Achim Gratz
2021-06-02 13:22             ` Michael Wild
2021-06-02 17:38               ` Michael Wild
2021-06-03  4:56                 ` ASSI
2021-06-05  5:33                 ` ASSI
2021-06-05 15:55                   ` Achim Gratz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgw4s3up.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).