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

2015-12-14 Thread Stefan Beller
The new method removes all common signal handlers that were installed
by sigchain_push.

CC: Jeff King 
Signed-off-by: Stefan Beller 
Signed-off-by: Junio C Hamano 
---
 sigchain.c | 9 +
 sigchain.h | 1 +
 2 files changed, 10 insertions(+)

diff --git a/sigchain.c b/sigchain.c
index faa375d..2ac43bb 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(SIGPIPE);
+   sigchain_pop(SIGQUIT);
+   sigchain_pop(SIGTERM);
+   sigchain_pop(SIGHUP);
+   sigchain_pop(SIGINT);
+}
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 */
-- 
2.6.4.443.ge094245.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2015-09-29 Thread Junio C Hamano
Stefan Beller  writes:

> The new method removes all common signal handlers that were installed
> by sigchain_push.
>
> CC: Jeff King 
> Signed-off-by: Stefan Beller 
> ---
>  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.

>
> 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 */
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

2015-09-28 Thread Stefan Beller
The new method removes all common signal handlers that were installed
by sigchain_push.

CC: Jeff King 
Signed-off-by: Stefan Beller 
---
 sigchain.c | 9 +
 sigchain.h | 1 +
 2 files changed, 10 insertions(+)

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 */
-- 
2.5.0.273.g6fa2560.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html