From: Eric Freese <ericdfreese@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: [PATCH] Remove zpty exit hook from forked processes
Date: Wed, 1 Feb 2017 18:25:52 -0700 [thread overview]
Message-ID: <CAAikoAJJumUO3mGce5ptEaRqKX+yN6JFd6QKiOsECeG9Bx5K8A@mail.gmail.com> (raw)
In-Reply-To: <170201165613.ZM2163@torch.brasslantern.com>
[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]
Ok, here's an updated patch.
---
Src/Modules/zpty.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
index 2c87be1..3c1bef5 100644
--- a/Src/Modules/zpty.c
+++ b/Src/Modules/zpty.c
@@ -331,6 +331,7 @@ newptycmd(char *nam, char *pname, char **args, int
echo, int nblock)
/* This code copied from the clone module, except for getting *
* the descriptor from get_pty() and duplicating it to 0/1/2. */
+ deletehookfunc("exit", ptyhook);
clearjobtab(0);
ppid = getppid();
mypid = getpid();
@@ -852,6 +853,7 @@ bin_zpty(char *nam, char **args, Options ops,
UNUSED(int func))
}
}
+/**/
static int
ptyhook(UNUSED(Hookdef d), UNUSED(void *dummy))
{
--
On Wed, Feb 1, 2017 at 5:56 PM, Bart Schaefer <schaefer@brasslantern.com>
wrote:
>
> On Feb 1, 1:41pm, Eric Freese wrote:
> }
> } diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
>
> If the only meaningful diff is this one ...
>
> } + deletehookfunc("exit", ptyhook);
> } clearjobtab(0);
>
> ... then there is no reason to move around all those static functions.
> Just mark the one to be declared in the autogenerated header file.
>
>
> diff --git a/Src/Modules/zpty.c b/Src/Modules/zpty.c
> index 2c87be1..3c1bef5 100644
> --- a/Src/Modules/zpty.c
> +++ b/Src/Modules/zpty.c
> @@ -331,6 +331,7 @@ newptycmd(char *nam, char *pname, char **args, int
echo, int nblock)
> /* This code copied from the clone module, except for getting *
> * the descriptor from get_pty() and duplicating it to 0/1/2. */
>
> + deletehookfunc("exit", ptyhook);
> clearjobtab(0);
> ppid = getppid();
> mypid = getpid();
> @@ -852,6 +853,7 @@ bin_zpty(char *nam, char **args, Options ops,
UNUSED(int func))
> }
> }
>
> +/**/
> static int
> ptyhook(UNUSED(Hookdef d), UNUSED(void *dummy))
> {
next prev parent reply other threads:[~2017-02-03 16:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 20:41 Eric Freese
2017-02-02 0:56 ` Bart Schaefer
2017-02-02 1:25 ` Eric Freese [this message]
2017-02-02 17:38 ` Eric Freese
2017-02-03 0:49 ` Bart Schaefer
-- strict thread matches above, loose matches on Subject: below --
2017-02-01 6:12 Eric Freese
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=CAAikoAJJumUO3mGce5ptEaRqKX+yN6JFd6QKiOsECeG9Bx5K8A@mail.gmail.com \
--to=ericdfreese@gmail.com \
--cc=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).