projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: change session file loading order
[lttng-tools.git]
/
src
/
common
/
compat
/
compat-epoll.c
diff --git
a/src/common/compat/compat-epoll.c
b/src/common/compat/compat-epoll.c
index 25c9955045b3bb09435beea959d891c67f1c77a4..368fae19f6c3615b00760ce99b07d0b3250c7cf1 100644
(file)
--- a/
src/common/compat/compat-epoll.c
+++ b/
src/common/compat/compat-epoll.c
@@
-51,6
+51,11
@@
static int resize_poll_event(struct lttng_poll_event *events,
PERROR("realloc epoll add");
goto error;
}
PERROR("realloc epoll add");
goto error;
}
+ if (new_size > events->alloc_size) {
+ /* Zero newly allocated memory */
+ memset(ptr + events->alloc_size, 0,
+ (new_size - events->alloc_size) * sizeof(*ptr));
+ }
events->events = ptr;
events->alloc_size = new_size;
events->events = ptr;
events->alloc_size = new_size;
@@
-76,7
+81,7
@@
int compat_epoll_create(struct lttng_poll_event *events, int size, int flags)
size = poll_max_size;
}
size = poll_max_size;
}
- ret =
epoll_create1(
flags);
+ ret =
compat_glibc_epoll_create(size,
flags);
if (ret < 0) {
/* At this point, every error is fatal */
PERROR("epoll_create1");
if (ret < 0) {
/* At this point, every error is fatal */
PERROR("epoll_create1");
@@
-119,6
+124,11
@@
int compat_epoll_add(struct lttng_poll_event *events, int fd, uint32_t req_event
goto error;
}
goto error;
}
+ /*
+ * Zero struct epoll_event to ensure all representations of its
+ * union are zeroed.
+ */
+ memset(&ev, 0, sizeof(ev));
ev.events = req_events;
ev.data.fd = fd;
ev.events = req_events;
ev.data.fd = fd;
This page took
0.033152 seconds
and
4
git commands to generate.