fix: removed accidental VLA in _get_num_possible_cpus()
[lttng-ust.git] / src / common / smp.c
index d7ba23c4f263b2afec7fd906f2cc525fbd745dbd..980947cf4de9431880494a0d55914811ec974bd0 100644 (file)
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <limits.h>
 #include <unistd.h>
 #include <pthread.h>
 #include <stdlib.h>
 
 #include <urcu/compiler.h>
 
-#include "common/align.h"
 #include "common/logging.h"
 #include "common/smp.h"
 
@@ -190,11 +190,10 @@ error:
 static void _get_num_possible_cpus(void)
 {
        int ret;
-       int buf_len = LTTNG_UST_PAGE_SIZE;
-       char buf[buf_len];
+       char buf[LTTNG_UST_CPUMASK_SIZE];
 
        /* Get the possible cpu mask from sysfs, fallback to sysconf. */
-       ret = get_possible_cpu_mask_from_sysfs((char *) &buf, buf_len);
+       ret = get_possible_cpu_mask_from_sysfs((char *) &buf, LTTNG_UST_CPUMASK_SIZE);
        if (ret <= 0)
                goto fallback;
 
This page took 0.023711 seconds and 4 git commands to generate.