processes: Fix 'delay_rate' race condition
[collectd.git] / src / processes.c
index aa7cfa3..171dde9 100644 (file)
@@ -587,7 +587,8 @@ static void ps_list_add(const char *name, const char *cmdline,
                       entry->cpu_system_counter);
 
 #if HAVE_LIBTASKSTATS
-    ps_update_delay(ps, pse, entry);
+    if (entry->has_delay)
+      ps_update_delay(ps, pse, entry);
 #endif
   }
 }
@@ -1577,7 +1578,6 @@ static char *ps_get_cmdline(long pid,
     return NULL;
   }
 
-  info.pr_psargs[sizeof(info.pr_psargs) - 1] = 0;
   sstrncpy(buffer, info.pr_psargs, buffer_size);
 
   return buffer;