git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 5/8] sigchain: add command to pop all common signals

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 30, 2015, 05:23 UTC
Message-ID
<xmqq37xwa3au.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1443482046-25569-6-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 9 quoted lines
> The new method removes all common signal handlers that were installed
> by sigchain_push.
>
> CC: Jeff King <peff@peff.net>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  sigchain.c | 9 +++++++++
>  sigchain.h | 1 +
>  2 files changed, 10 insertions(+)

Sounds like a good idea, as you need to clean them all up if you did push_common() and ended up not receiving any signal.

This is merely pure aesthetics, but I somehow thought that ordering them in the reverse as listed in push_common() might make more sense, though.

Thanks.
Show 29 quoted lines
>
> diff --git a/sigchain.c b/sigchain.c
> index faa375d..9262307 100644
> --- a/sigchain.c
> +++ b/sigchain.c
> @@ -50,3 +50,12 @@ void sigchain_push_common(sigchain_fun f)
>  	sigchain_push(SIGQUIT, f);
>  	sigchain_push(SIGPIPE, f);
>  }
> +
> +void sigchain_pop_common(void)
> +{
> +	sigchain_pop(SIGINT);
> +	sigchain_pop(SIGHUP);
> +	sigchain_pop(SIGTERM);
> +	sigchain_pop(SIGQUIT);
> +	sigchain_pop(SIGPIPE);
> +}
> diff --git a/sigchain.h b/sigchain.h
> index 618083b..138b20f 100644
> --- a/sigchain.h
> +++ b/sigchain.h
> @@ -7,5 +7,6 @@ int sigchain_push(int sig, sigchain_fun f);
>  int sigchain_pop(int sig);
>  
>  void sigchain_push_common(sigchain_fun f);
> +void sigchain_pop_common(void);
>  
>  #endif /* SIGCHAIN_H */
Previous: Stefan BellerNext: Stefan Beller
Message 7 of 13 in “fetch submodules in parallel”
  1. 0/8 fetch submodules in parallelStefan Beller, Sep 28, 2015
  2. 1/8 submodule.c: write "Fetching submodule <foo>" to stderrStefan Beller, Sep 28, 2015
  3. 2/8 xread: poll on non blocking fdsStefan Beller, Sep 28, 2015
  4. 3/8 xread_nonblock: add functionality to read from fds without blockingStefan Beller, Sep 28, 2015
  5. 4/8 strbuf: add strbuf_read_once to read without blockingStefan Beller, Sep 28, 2015
  6. 5/8 sigchain: add command to pop all common signalsStefan Beller, Sep 28, 2015
  7. Junio C HamanoSep 30, 2015
  8. 6/8 run-command: add an asynchronous parallel child processorStefan Beller, Sep 28, 2015
  9. Junio C HamanoSep 30, 2015
  10. Stefan BellerSep 30, 2015
  11. Junio C HamanoSep 30, 2015
  12. 7/8 fetch_populated_submodules: use new parallel job processingStefan Beller, Sep 28, 2015
  13. 8/8 submodules: allow parallel fetching, add tests and documentationStefan Beller, Sep 28, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.