X-Git-Url: https://git.realraum.at/?a=blobdiff_plain;f=powersensordaemon%2Fautosample.c;h=00ab7d8c6416fd07dead97fda8ba3c0a5d2dc1a5;hb=26a46e58c6449468c98df0b7a5f94870bb9c4aea;hp=a46862588e0d6b116c757d26c398ad41011957ce;hpb=2b72e9339a620b831f2dc4c24fd95ee9096e608d;p=svn42.git diff --git a/powersensordaemon/autosample.c b/powersensordaemon/autosample.c index a468625..00ab7d8 100644 --- a/powersensordaemon/autosample.c +++ b/powersensordaemon/autosample.c @@ -146,6 +146,7 @@ int autosample_process(options_t *opt, int writefd, int readfd) devices[i].device_name_ = k->string_; k = k->next_; v = v->next_; + i++; } int sig_fd = signal_init(); @@ -163,8 +164,8 @@ int autosample_process(options_t *opt, int writefd, int readfd) unsigned char sample_enabled = 0; while(!return_value) { memcpy(&tmpfds, &readfds, sizeof(tmpfds)); - timeout.tv_sec = 0; - timeout.tv_usec = 1000000; + timeout.tv_sec = 1; + timeout.tv_usec = 0; int ret = select(max_fd+1, &tmpfds, NULL, NULL, &timeout); if(ret == -1 && errno != EINTR) { log_printf(ERROR, "autosample process select returned with error: %s", strerror(errno));