Fix compile time issues
authorMatthias Runge <mrunge@redhat.com>
Thu, 8 Aug 2019 09:58:55 +0000 (11:58 +0200)
committerMatthias Runge <mrunge@redhat.com>
Thu, 8 Aug 2019 09:58:55 +0000 (11:58 +0200)
This resolves #3242 and should also resolve #3179.

Signed-off-by: Matthias Runge <mrunge@redhat.com>
src/daemon/plugin.c
src/intel_rdt.c

index 1f8ab2d..daddf68 100644 (file)
@@ -647,7 +647,8 @@ static void start_read_threads(size_t num) /* {{{ */
     }
 
     char name[THREAD_NAME_MAX];
-    snprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num);
+    ssnprintf(name, sizeof(name), "reader#%" PRIu64,
+              (uint64_t)read_threads_num);
     set_thread_name(read_threads[read_threads_num], name);
 
     read_threads_num++;
@@ -836,8 +837,8 @@ static void start_write_threads(size_t num) /* {{{ */
     }
 
     char name[THREAD_NAME_MAX];
-    snprintf(name, sizeof(name), "writer#%" PRIu64,
-             (uint64_t)write_threads_num);
+    ssnprintf(name, sizeof(name), "writer#%" PRIu64,
+              (uint64_t)write_threads_num);
     set_thread_name(write_threads[write_threads_num], name);
 
     write_threads_num++;
index 515a601..62848db 100644 (file)
@@ -325,8 +325,12 @@ static int strlisttoarray(char *str_list, char ***names, size_t *names_num) {
       continue;
 
     if ((isdupstr((const char **)*names, *names_num, token))) {
-      ERROR(RDT_PLUGIN ": Duplicated process name \'%s\' in group \'%s\'",
-            token, str_list);
+      if (str_list != NULL)
+        ERROR(RDT_PLUGIN ": Duplicated process name \'%s\' in group \'%s\'",
+              token, str_list);
+      else
+        ERROR(RDT_PLUGIN ": Duplicated process name \'%s\'", token);
+
       return -EINVAL;
     } else {
       if (0 != strarray_add(names, names_num, token)) {