projects
/
lttng-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9284ac
)
Fix: handle sysconf possible negative returned value
author
David Goulet
<dgoulet@efficios.com>
Wed, 1 Oct 2014 18:57:36 +0000
(14:57 -0400)
committer
David Goulet
<dgoulet@efficios.com>
Wed, 1 Oct 2014 18:58:24 +0000
(14:58 -0400)
Fixes Coverity issue
1019947
.
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/shm.c
patch
|
blob
|
blame
|
history
diff --git
a/src/bin/lttng-sessiond/shm.c
b/src/bin/lttng-sessiond/shm.c
index 7bb52d4ee2feeb513d59079bf11813f319d8c48a..a5caa8bb6cdd3ab054872caedb86d362dd714d64 100644
(file)
--- a/
src/bin/lttng-sessiond/shm.c
+++ b/
src/bin/lttng-sessiond/shm.c
@@
-132,12
+132,20
@@
error:
*/
char *shm_ust_get_mmap(char *shm_path, int global)
{
- size_t mmap_size
= sysconf(_SC_PAGE_SIZE)
;
+ size_t mmap_size;
int wait_shm_fd, ret;
char *wait_shm_mmap;
+ long sys_page_size;
assert(shm_path);
+ sys_page_size = sysconf(_SC_PAGE_SIZE);
+ if (sys_page_size < 0) {
+ PERROR("sysconf PAGE_SIZE");
+ goto error;
+ }
+ mmap_size = sys_page_size;
+
wait_shm_fd = get_wait_shm(shm_path, mmap_size, global);
if (wait_shm_fd < 0) {
goto error;
This page took
0.026037 seconds
and
4
git commands to generate.