[pacman-dev] [PATCH 1/4] Revert refactoring in fa0c1e14

Dave Reisner d at falconindy.com
Sat Jun 28 21:45:05 EDT 2014


On Sun, Jun 29, 2014 at 11:27:31AM +1000, Allan McRae wrote:
> This will cause the code to break as soon as we handle another signal such
> as SIGWINCH...
> 
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
> 
> Well...  that didn't last long.
> 

Seems to me the thing to do is to declare a mapping between signum and
handler, rather than declaring a signal handler for everything, and then
littering the logic with if/else.

I can send a patch on top of my SIGWINCH patch...

>  src/pacman/pacman.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
> index e8c5f9e..baa0485 100644
> --- a/src/pacman/pacman.c
> +++ b/src/pacman/pacman.c
> @@ -301,7 +301,7 @@ static void handler(int signum)
>  			"Please submit a full bug report with --debug if appropriate.\n";
>  		xwrite(err, msg, strlen(msg));
>  		exit(signum);
> -	} else if(signum != SIGTERM) {
> +	} else if(signum == SIGINT || signum == SIGHUP) {
>  		if(signum == SIGINT) {
>  			msg = "\nInterrupt signal received\n";
>  		} else {
> -- 
> 2.0.1
> 
> 


More information about the pacman-dev mailing list