]> git.mdlowis.com Git - projs/tide.git/commitdiff
added telemetry viewer script changed job.c to only output when poll returns non...
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 30 Oct 2019 13:31:05 +0000 (09:31 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 30 Oct 2019 13:31:05 +0000 (09:31 -0400)
bin/view-telem [new file with mode: 0755]
src/lib/job.c

diff --git a/bin/view-telem b/bin/view-telem
new file mode 100755 (executable)
index 0000000..2b406a8
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+while [[ 1 ]]; do
+    cat ~/tide-telem
+done
\ No newline at end of file
index 89fa95387a2fe22da32b05d05ec7252a1510909b..a2094d263751779e2fbe83c7e2fec372a73b5fbe 100644 (file)
@@ -167,18 +167,20 @@ bool job_poll(int ms)
         if (job->writefn) JobFds[njobs].events |= POLLOUT;
         if (JobFds[njobs].events) njobs++;
     }
+
     /* Poll until a job is ready, call the functions based on events */
     long ret = poll(JobFds, njobs, ms);
-    telem_send("POLL(njobs: %d, ms: %d, ret: %d)\n", njobs, ms, ret);
-    if (ret < 0)
+    if (ret != 0)
     {
-        perror("poll() failed: ");
-        exit(1);
+        telem_send("POLL(njobs: %d, ms: %d, ret: %d)\n", njobs, ms, ret);
     }
+
+    /* process all jobs with events reported */
     for (int i = 0; i < njobs; i++)
     {
         job_process(JobFds[i].fd, JobFds[i].revents);
     }
+
     /* reap zombie processes */
     for (int status; waitpid(-1, &status, WNOHANG) > 0;);
     return (ret > 0);