X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fpoll.cpp;h=4f532a26d66715adc77cafce1ba30481112449b8;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hp=928867ffb3f5a9ac5dffbe00d5dd905d89d5e07e;hpb=740da7d5000ca1ffdcf14bda5096bf7ccfb86bdd;p=lttng-tools.git diff --git a/src/common/compat/poll.cpp b/src/common/compat/poll.cpp index 928867ffb..4f532a26d 100644 --- a/src/common/compat/poll.cpp +++ b/src/common/compat/poll.cpp @@ -1,8 +1,8 @@ /* - * Copyright (C) 2011 David Goulet + * Copyright (C) 2011 EfficiOS Inc. * Copyright (C) 2019 Yannick Lamarre * - * SPDX-License-Identifier: GPL-2.0-only + * SPDX-License-Identifier: LGPL-2.1-only * */ @@ -10,14 +10,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include "poll.h" +#include "poll.hpp" -#if HAVE_EPOLL +#ifdef HAVE_EPOLL #include #include @@ -374,7 +374,7 @@ static int resize_poll_event(struct compat_poll_event_array *array, goto error; } - ptr = realloc(array->events, new_size * sizeof(*ptr)); + ptr = (struct pollfd *) realloc(array->events, new_size * sizeof(*ptr)); if (ptr == NULL) { PERROR("realloc epoll add"); goto error; @@ -455,7 +455,7 @@ int compat_poll_create(struct lttng_poll_event *events, int size) wait = &events->wait; /* This *must* be freed by using lttng_poll_free() */ - wait->events = zmalloc(size * sizeof(struct pollfd)); + wait->events = (struct pollfd *) zmalloc(size * sizeof(struct pollfd)); if (wait->events == NULL) { PERROR("zmalloc struct pollfd"); goto error; @@ -463,7 +463,7 @@ int compat_poll_create(struct lttng_poll_event *events, int size) wait->alloc_size = wait->init_size = size; - current->events = zmalloc(size * sizeof(struct pollfd)); + current->events = (struct pollfd *) zmalloc(size * sizeof(struct pollfd)); if (current->events == NULL) { PERROR("zmalloc struct current pollfd"); goto error;