summaryrefslogtreecommitdiff
path: root/app-metrics/collectd/files/collectd-5.9.1-fixup.patch
blob: 93f97d95a9c4582581fca31133909b7581441e7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--- a/src/daemon/plugin.c
+++ b/src/daemon/plugin.c
@@ -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++;
--- a/src/intel_rdt.c
+++ b/src/intel_rdt.c
@@ -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)) {
--- a/src/intel_rdt.c
+++ b/src/intel_rdt.c
@@ -325,11 +325,7 @@ static int strlisttoarray(char *str_list, char ***names, size_t *names_num) {
       continue;
 
     if ((isdupstr((const char **)*names, *names_num, token))) {
-      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);
+      ERROR(RDT_PLUGIN ": Duplicated process name \'%s\'", token);
 
       return -EINVAL;
     } else {
--- a/src/syslog.c
+++ b/src/syslog.c
@@ -51,8 +51,7 @@ static int sl_config(const char *key, const char *value) {
     log_level = parse_log_severity(value);
     if (log_level < 0) {
       log_level = LOG_INFO;
-      ERROR("syslog: invalid loglevel [%s] defaulting to 'info'", value);
-      return 1;
+      WARNING("syslog: invalid loglevel [%s] defaulting to 'info'", value);
     }
   } else if (strcasecmp(key, "NotifyLevel") == 0) {
     notif_severity = parse_notif_severity(value);
--- a/src/utils/common/common.c
+++ b/src/utils/common/common.c
@@ -99,10 +99,7 @@ int ssnprintf(char *str, size_t sz, const char *format, ...) {
 
   va_end(ap);
 
-  if (ret < 0) {
-    return ret;
-  }
-  return (size_t)ret >= sz;
+  return ret;
 } /* int ssnprintf */
 
 char *ssnprintf_alloc(char const *format, ...) /* {{{ */