header[len] = 0;
/* thanks to lye, who showed me how to redirect stdin/stdout */
- old_stdout = dup(1);
+ old_stdout = dup(STDOUT_FILENO);
while (1) {
time(&t);
sleep(period);
} else if (0 == pid) {
//child
- close(1);
- dup(old_stdout);
+ dup2(old_stdout, STDOUT_FILENO);
execvp(*watched_argv, watched_argv);
bb_perror_msg_and_die(*watched_argv);
} else {