Fix: compat poll: add missing empty revents checks
[lttng-tools.git] / src / bin / lttng-relayd / health-relayd.c
index 5c4fb50a15154794b76aec6284b3940479baf7ab..75149ba4b46526a0494bfea623b3115c676064d4 100644 (file)
@@ -161,6 +161,10 @@ int setup_health_path(void)
 
        if (is_root) {
                rundir = strdup(DEFAULT_LTTNG_RUNDIR);
+               if (!rundir) {
+                       ret = -ENOMEM;
+                       goto end;
+               }
        } else {
                /*
                 * Create rundir from home path. This will create something like
@@ -326,6 +330,11 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
+                       if (!revents) {
+                               /* No activity for this FD (poll implementation). */
+                               continue;
+                       }
+
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = check_health_quit_pipe(pollfd, revents);
                        if (ret) {
This page took 0.023127 seconds and 4 git commands to generate.