projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: removed accidental VLA in _get_num_possible_cpus()
[lttng-ust.git]
/
src
/
common
/
smp.c
diff --git
a/src/common/smp.c
b/src/common/smp.c
index d7ba23c4f263b2afec7fd906f2cc525fbd745dbd..980947cf4de9431880494a0d55914811ec974bd0 100644
(file)
--- a/
src/common/smp.c
+++ b/
src/common/smp.c
@@
-10,13
+10,13
@@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#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 <unistd.h>
#include <pthread.h>
#include <stdlib.h>
#include <urcu/compiler.h>
-#include "common/align.h"
#include "common/logging.h"
#include "common/smp.h"
#include "common/logging.h"
#include "common/smp.h"
@@
-190,11
+190,10
@@
error:
static void _get_num_possible_cpus(void)
{
int ret;
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. */
/* 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;
if (ret <= 0)
goto fallback;
This page took
0.023188 seconds
and
4
git commands to generate.