Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Remove zpty exit hook from forked processes
- X-seq: zsh-workers 40491
- From: Eric Freese <ericdfreese@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] Remove zpty exit hook from forked processes
- Date: Wed, 1 Feb 2017 18:25:52 -0700
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=a5E9PzjIkutSHjcpJhsSHFyeixlhEjQ0geqPLsLgibU=; b=DJNIHeChP3DVHaBIptfjbqwO1hmDrsl8h/yR++SmkcYQa17t8oplM582L6uSV2e5Tg 3uKB9ksO+60MHElkcR0fLZgnRoKNFXolSSkIgzCF8IjQtYBq9X42qESiQUs2M27kPoKv sNXhFaS6+J7Bw8LNbO7Vswfh4HUA9j/byMAjUh4wDgw9qOXl2mK3TqHORI825dD8L9Gc MHgjLOzXHBxiyOyIDKmfmtGhl64le9+spfpwb4Rm9PtVpT/akEYZUc59fcN/IIa3YZV8 M5YpjDMrnW8inOT8E/ggRRnA+Yuy40fk9qas5zjejH0DM+kQ8479NB7Axyle1hsC0sKW IVdg==
- In-reply-to: <170201165613.ZM2163@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20170201204114.53246-1-ericdfreese@gmail.com> <170201165613.ZM2163@torch.brasslantern.com>
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@xxxxxxxxxxxxxxxx>
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))
> {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author