#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
#include <fcntl.h>
*
*/
void cleanup() {
- ev_io_stop(main_loop, stdin_io);
- ev_child_stop(main_loop, child_sig);
- FREE(stdin_io);
- FREE(child_sig);
- FREE(statusline_buffer);
+ if (stdin_io != NULL) {
+ ev_io_stop(main_loop, stdin_io);
+ ev_child_stop(main_loop, child_sig);
+ FREE(stdin_io);
+ FREE(child_sig);
+ FREE(statusline_buffer);
+ }
}
/*
if (child_pid != 0) {
kill(child_pid, SIGCONT);
kill(child_pid, SIGTERM);
+ int status;
+ waitpid(child_pid, &status, 0);
+ child_pid = 0;
+ cleanup();
}
- cleanup();
}
/*