Index: trunk/Ohana/src/opihi/cmd.basic/shell.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.basic/shell.c	(revision 33662)
+++ trunk/Ohana/src/opihi/cmd.basic/shell.c	(revision 39457)
@@ -51,5 +51,5 @@
   // wait for process to finish or timeout
   // loop forever if desired, but catch C-C and stop the process on interrupt
-  interrupt = FALSE;
+  struct sigaction *old_sigaction = SetInterrupt();
   while (!interrupt) {
     result = waitpid (pid, &wait_status, WNOHANG);
@@ -59,4 +59,5 @@
 	  case ECHILD:
 	    gprint (GP_ERR, "unknown PID, not a child process: %d\n", pid);
+	    ClearInterrupt (old_sigaction);
 	    return (FALSE);
 	  default:
@@ -72,4 +73,5 @@
 	  if (DTIME(now, start) > timeout) {
 	    gprint (GP_ERR, "timeout on %s (pid %d)\n", argv[1], pid);
+	    ClearInterrupt (old_sigaction);
 	    return (FALSE);
 	  }
@@ -83,4 +85,5 @@
 	}
 	if (WIFEXITED(wait_status)) {
+	  ClearInterrupt (old_sigaction);
 	  exit_status = WEXITSTATUS(wait_status);
 	  if (exit_status) {
@@ -91,4 +94,5 @@
 	}
 	if (WIFSIGNALED(wait_status)) {
+	  ClearInterrupt (old_sigaction);
 	  gprint (GP_ERR, "job %d exited on signal %d\n", pid, WTERMSIG(wait_status));
 	  return (FALSE);
@@ -100,4 +104,5 @@
     }
   }
+  ClearInterrupt (old_sigaction);
   gprint (GP_ERR, "caught interrupt, killing %s (%d)\n", argv[1], pid);
 
