Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 122784
Collapse All | Expand All

(-)admin/socklog-2.0.2/src/tryto.c (-4 / +6 lines)
Lines 104-109 Link Here
104
  taia_now(&now);
104
  taia_now(&now);
105
  taia_uint(&deadline, timeout);
105
  taia_uint(&deadline, timeout);
106
  taia_add(&deadline, &now, &deadline);
106
  taia_add(&deadline, &now, &deadline);
107
  timeout =0;
107
108
108
  for (;;) {
109
  for (;;) {
109
    int iopausefds;
110
    int iopausefds;
Lines 163-178 Link Here
163
      int i;
164
      int i;
164
      char *s;
165
      char *s;
165
166
166
      if (wait_nohang(&rc) == pid) break;
167
      taia_now(&now);
168
      if ((timeout =taia_less(&deadline, &now))) break;
169
170
      sig_unblock(sig_child);
167
      sig_unblock(sig_child);
171
      iopause(x, iopausefds, &deadline, &now);
168
      iopause(x, iopausefds, &deadline, &now);
172
      sig_block(sig_child);
169
      sig_block(sig_child);
173
      
170
      
174
      while (read(selfpipe[0], &ch, 1) == 1) {}
171
      while (read(selfpipe[0], &ch, 1) == 1) {}
175
172
173
      taia_now(&now);
174
      if ((timeout =taia_less(&deadline, &now))) break;
175
      if (wait_nohang(&rc) == pid) break;
176
176
      r = buffer_feed(&buffer_x);
177
      r = buffer_feed(&buffer_x);
177
      if (r < 0) {
178
      if (r < 0) {
178
	if ((errno == error_intr) || (errno == error_again)) continue;
179
	if ((errno == error_intr) || (errno == error_again)) continue;
Lines 201-206 Link Here
201
    close(cpipe[1]);
202
    close(cpipe[1]);
202
203
203
    if (timeout) {
204
    if (timeout) {
205
      if (wait_nohang(&rc) == pid) break;
204
      /* child not finished */
206
      /* child not finished */
205
      strerr_warn4(WARNING,
207
      strerr_warn4(WARNING,
206
		   "child \"", *argv, "\" timed out. sending TERM...", 0);
208
		   "child \"", *argv, "\" timed out. sending TERM...", 0);

Return to bug 122784