- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/Ohana.20100407 27635-27772 /branches/pap_delete/Ohana 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/Ohana/src/opihi/pclient/pclient.c.in
r18123 r27838 46 46 47 47 /* ignore the history file. to change this, see, eg, mana.c */ 48 signal (SIGPIPE, gotsignal); 48 49 /* We do not want pclient to exit just because the connection to the 50 child process is broken. However, if the connection to the parent 51 process is broken, we should exit. To handle this, we define 52 pipe_signal() which tracks the number of times it has been called. 53 Every time an I/O operation on the child file descriptor raises this signal, 54 we need to manage the crashed child and then clear the count. Signals raised by 55 I/O to the parent do not result in clearing the count. If the count passes a maximum, 56 we exit pclient */ 57 58 signal (SIGPIPE, pipe_signal); 49 59 signal (SIGTSTP, gotsignal); 50 60 signal (SIGTTIN, gotsignal); … … 67 77 } 68 78 79 static int Npipe = 0; 80 81 void pipe_signal (int signum) { 82 Npipe ++; 83 if (Npipe > 100) { 84 exit (5); 85 } 86 gprint (GP_ERR, "closed pipe : did child process exit unexpectedly?\n"); 87 return; 88 } 89 90 void pipe_signal_clear(void) { 91 Npipe = 0; 92 } 93 69 94 void gotsignal (int signum) { 70 95 gprint (GP_ERR, "got signal : %d\n", signum);
Note:
See TracChangeset
for help on using the changeset viewer.
