return (1);
}
buf[i] = '\0';
- printf("Child said (%d, %d): <<%s>>\n", child_state, child_pid, buf);
+ fprintf(stderr, "Child said (%d, %d): <<%s>>\n", child_state, child_pid, buf);
return (0);
}
exit (1);
}
- printf("start child pid %d\n", i);
+ fprintf(stderr, "start child pid %d\n", i);
AZ(close(child_fds[1]));
child_fds[1] = -1;
}
ev_poker = NULL;
- printf("Clean child\n");
+ fprintf(stderr, "Clean child\n");
mgt_cli_stop_child();
/* We tell the child to die gracefully by closing the CLI */
AZ(close(heritage.fds[3]));
heritage.fds[3] = -1;
- printf("Child stopping\n");
+ fprintf(stderr, "Child stopping\n");
}
/*--------------------------------------------------------------------*/
r = wait4(-1, &status, WNOHANG, NULL);
if (r != child_pid) {
- printf("Unknown child died pid=%d status=0x%x\n",
+ fprintf(stderr, "Unknown child died pid=%d status=0x%x\n",
r, status);
return (0);
}
- printf("Cache child died pid=%d status=0x%x\n", r, status);
+ fprintf(stderr, "Cache child died pid=%d status=0x%x\n", r, status);
child_pid = -1;
if (child_state == CH_RUNNING) {
child_state = CH_DIED;
- printf("Clean child\n");
+ fprintf(stderr, "Clean child\n");
mgt_cli_stop_child();
/* We tell the child to die gracefully by closing the CLI */
AZ(close(child_fds[0]));
child_fds[0] = -1;
- printf("Child cleaned\n");
+ fprintf(stderr, "Child cleaned\n");
if (child_state == CH_DIED)
start_child();
(void)e;
(void)what;
- printf("Manager got SIGINT\n");
+ fprintf(stderr, "Manager got SIGINT\n");
fflush(stdout);
if (child_pid >= 0)
stop_child();
{
struct sigaction sac;
struct ev *e;
+ int i;
mgt_pid = getpid();
if (!dflag)
start_child();
- ev_schedule(mgt_evb);
+ i = ev_schedule(mgt_evb);
+ fprintf(stderr, "ev_schedule = %d\n", i);
- printf("manager dies\n");
+ fprintf(stderr, "manager dies\n");
exit(2);
}