}
if (cpid == 0) {
- close(pipefd[1]);
- return autosample_process(opt, pipefd[0]);
+ close(pipefd[0]);
+ return autosample_process(opt, pipefd[1]);
}
- close(pipefd[0]);
- return pipefd[1];
+ close(pipefd[1]);
+ return pipefd[0];
}
int autosample_process(options_t *opt, int pipefd)
}
if(ret == -1)
continue;
-// if(!ret) {
+ if(!ret) {
// timout has expired...
-// }
+ write(pipefd, "sample temp0", 12);
+ char c = '\n';
+ write(pipefd, &c, 1);
+ }
if(FD_ISSET(sig_fd, &readfds)) {
if(signal_handle()) {
if(FD_ISSET(autosample_fd, &tmpfds)) {
return_value = nonblock_readline(&autosample_buffer, autosample_fd, &cmd_q, client_lst, opt);
if(return_value == 2) {
- log_printf(WARNING, "autosample process has crashed, removing pipe to it");
+ log_printf(WARNING, "autosample not running, removing pipe to it");
FD_CLR(autosample_fd, &readfds);
return_value = 0;
continue;