This allows ^C to exit iscsid but only when it is running in foreground
mode, which is useful for testing.

Signed-off-by: Jim Ramsay <jim_ram...@dell.com>
---
 usr/iscsid.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/usr/iscsid.c b/usr/iscsid.c
index 1a37347..9df6658 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -304,6 +304,11 @@ static void iscsid_shutdown(void)
 static void catch_signal(int signo)
 {
        log_debug(1, "pid %d caught signal %d", getpid(), signo);
+
+       /* In foreground mode, treat SIGINT like SIGTERM */
+       if (!daemonize && signo == SIGINT)
+               signo = SIGTERM;
+
        switch (signo) {
        case SIGTERM:
                iscsid_shutdown();
-- 
1.7.6

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to