Changeset 26782
- Timestamp:
- Feb 5, 2010, 1:20:45 PM (16 years ago)
- Location:
- branches/eam_branches/20091201/Ohana
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
src/opihi/include/pclient.h (modified) (1 diff)
-
src/opihi/pclient/ChildOps.c (modified) (3 diffs)
-
src/opihi/pclient/pclient.c.in (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20091201/Ohana
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/Ohana merged eligible /branches/eam_branches/20091113/Ohana 26119-26255
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/eam_branches/20091201/Ohana/src/opihi/include/pclient.h
r21153 r26782 52 52 void FreePclient (void); 53 53 void gotsignal (int signum); 54 void pipe_signal (int signum); 55 void pipe_signal_clear(void); 54 56 55 57 # define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec)) -
branches/eam_branches/20091201/Ohana/src/opihi/pclient/ChildOps.c
r26257 r26782 1 1 # include "pclient.h" 2 # include <sys/ioctl.h>3 # include <sys/types.h>4 # include <unistd.h>2 # include <sys/ioctl.h> 3 # include <sys/types.h> 4 # include <unistd.h> 5 5 // #include <stropts.h> 6 6 … … 67 67 case 0: /* pipe is closed */ 68 68 /** change child state? **/ 69 pipe_signal_clear(); 69 70 break; 70 71 default: /* data in pipe */ … … 81 82 case 0: /* pipe is closed */ 82 83 /** change child state? **/ 84 pipe_signal_clear(); 83 85 break; 84 86 default: /* data in pipe */ -
branches/eam_branches/20091201/Ohana/src/opihi/pclient/pclient.c.in
r18123 r26782 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.
