projects
/
svn42.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed pipe direction, added test sample command
[svn42.git]
/
powersensordaemon
/
autosample.c
diff --git
a/powersensordaemon/autosample.c
b/powersensordaemon/autosample.c
index
63dd5c8
..
bcba8c2
100644
(file)
--- a/
powersensordaemon/autosample.c
+++ b/
powersensordaemon/autosample.c
@@
-51,12
+51,12
@@
int start_autosample_process(options_t* opt)
}
if (cpid == 0) {
}
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)
}
int autosample_process(options_t *opt, int pipefd)
@@
-82,9
+82,12
@@
int autosample_process(options_t *opt, int pipefd)
}
if(ret == -1)
continue;
}
if(ret == -1)
continue;
-// if(!ret) {
+ if(!ret) {
// timout has expired...
// 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(sig_fd, &readfds)) {
if(signal_handle()) {