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]
/
libringbuffer
/
smp.c
diff --git
a/libringbuffer/smp.c
b/libringbuffer/smp.c
index 8b66b9e83fd08b88c6b70798000781898af1a562..966556dcee15cf38b0a4b6e86d1f47ccd878169b 100644
(file)
--- a/
libringbuffer/smp.c
+++ b/
libringbuffer/smp.c
@@
-30,6
+30,7
@@
#include <stdlib.h>
#include <unistd.h>
#include <stdlib.h>
#include <unistd.h>
+#include "align.h"
#include "smp.h"
#include "usterr-signal-safe.h"
#include "smp.h"
#include "usterr-signal-safe.h"
@@
-206,11
+207,10
@@
error:
void _get_num_possible_cpus(void)
{
int ret;
void _get_num_possible_cpus(void)
{
int ret;
- int buf_len = sysconf(_SC_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.022872 seconds
and
4
git commands to generate.