From 5d0e3dd646d964e22d2a0a48281fa2341a09e9cf Mon Sep 17 00:00:00 2001 From: "John \"Elwin\" Edwards" Date: Mon, 8 Jun 2015 10:01:25 -0400 Subject: [PATCH] Don't swap signal handlers in md_shellescape(). md_shellescape() sets SIGINT and SIGQUIT to be ignored, storing the previous handlers, and restores them after the shell exits. But it mixed up the two handlers. Since the signals were usually handled by the same function, this fix doesn't have much effect, but anything that makes signal code less confusing is a good thing. --- arogue5/mdport.c | 4 ++-- arogue7/mdport.c | 4 ++-- rogue3/mdport.c | 4 ++-- rogue4/mdport.c | 4 ++-- rogue5/mdport.c | 4 ++-- srogue/mdport.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/arogue5/mdport.c b/arogue5/mdport.c index ad6cddc..d479444 100644 --- a/arogue5/mdport.c +++ b/arogue5/mdport.c @@ -403,9 +403,9 @@ md_shellescape() while (wait(&ret_status) != pid) continue; - signal(SIGINT, myquit); + signal(SIGINT, myend); #ifdef SIGQUIT - signal(SIGQUIT, myend); + signal(SIGQUIT, myquit); #endif } diff --git a/arogue7/mdport.c b/arogue7/mdport.c index 025de61..6508cae 100644 --- a/arogue7/mdport.c +++ b/arogue7/mdport.c @@ -385,9 +385,9 @@ md_shellescape() while (wait(&ret_status) != pid) continue; - signal(SIGINT, myquit); + signal(SIGINT, myend); #ifdef SIGQUIT - signal(SIGQUIT, myend); + signal(SIGQUIT, myquit); #endif } diff --git a/rogue3/mdport.c b/rogue3/mdport.c index 6732f62..a489454 100644 --- a/rogue3/mdport.c +++ b/rogue3/mdport.c @@ -596,9 +596,9 @@ md_shellescape(void) while (wait(&ret_status) != pid) continue; - signal(SIGINT, myquit); + signal(SIGINT, myend); #ifdef SIGQUIT - signal(SIGQUIT, myend); + signal(SIGQUIT, myquit); #endif } return(ret_status); diff --git a/rogue4/mdport.c b/rogue4/mdport.c index 4db7989..28f26b1 100644 --- a/rogue4/mdport.c +++ b/rogue4/mdport.c @@ -432,9 +432,9 @@ md_shellescape() while (wait(&ret_status) != pid) continue; - signal(SIGINT, myquit); + signal(SIGINT, myend); #ifdef SIGQUIT - signal(SIGQUIT, myend); + signal(SIGQUIT, myquit); #endif } diff --git a/rogue5/mdport.c b/rogue5/mdport.c index 62731ed..035dc28 100644 --- a/rogue5/mdport.c +++ b/rogue5/mdport.c @@ -598,9 +598,9 @@ md_shellescape(void) while (wait(&ret_status) != pid) continue; - signal(SIGINT, myquit); + signal(SIGINT, myend); #ifdef SIGQUIT - signal(SIGQUIT, myend); + signal(SIGQUIT, myquit); #endif } return(ret_status); diff --git a/srogue/mdport.c b/srogue/mdport.c index b9156e1..8c16026 100644 --- a/srogue/mdport.c +++ b/srogue/mdport.c @@ -610,9 +610,9 @@ md_shellescape(void) while (wait(&ret_status) != pid) continue; - signal(SIGINT, myquit); + signal(SIGINT, myend); #ifdef SIGQUIT - signal(SIGQUIT, myend); + signal(SIGQUIT, myquit); #endif } return(ret_status);