to github
[svn42.git] / powersensordaemon / autosample.c
index a468625..00ab7d8 100644 (file)
@@ -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));