Changeset 39457 for trunk/Ohana/src/opihi/cmd.basic/shell.c
- Timestamp:
- Mar 11, 2016, 10:23:42 PM (10 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/opihi/cmd.basic/shell.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana
-
Property svn:mergeinfo
set to
/branches/eam_branches/ohana.20160226 merged eligible
-
Property svn:mergeinfo
set to
-
trunk/Ohana/src/opihi/cmd.basic/shell.c
r33662 r39457 51 51 // wait for process to finish or timeout 52 52 // loop forever if desired, but catch C-C and stop the process on interrupt 53 interrupt = FALSE;53 struct sigaction *old_sigaction = SetInterrupt(); 54 54 while (!interrupt) { 55 55 result = waitpid (pid, &wait_status, WNOHANG); … … 59 59 case ECHILD: 60 60 gprint (GP_ERR, "unknown PID, not a child process: %d\n", pid); 61 ClearInterrupt (old_sigaction); 61 62 return (FALSE); 62 63 default: … … 72 73 if (DTIME(now, start) > timeout) { 73 74 gprint (GP_ERR, "timeout on %s (pid %d)\n", argv[1], pid); 75 ClearInterrupt (old_sigaction); 74 76 return (FALSE); 75 77 } … … 83 85 } 84 86 if (WIFEXITED(wait_status)) { 87 ClearInterrupt (old_sigaction); 85 88 exit_status = WEXITSTATUS(wait_status); 86 89 if (exit_status) { … … 91 94 } 92 95 if (WIFSIGNALED(wait_status)) { 96 ClearInterrupt (old_sigaction); 93 97 gprint (GP_ERR, "job %d exited on signal %d\n", pid, WTERMSIG(wait_status)); 94 98 return (FALSE); … … 100 104 } 101 105 } 106 ClearInterrupt (old_sigaction); 102 107 gprint (GP_ERR, "caught interrupt, killing %s (%d)\n", argv[1], pid); 103 108
Note:
See TracChangeset
for help on using the changeset viewer.
