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;
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;
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;
static inline
int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid)
{
+ socklen_t pid_len = (socklen_t) sizeof(*pid);
+
/* The getsockopt LOCAL_PEERPID option is available since macOS 10.8. */
- return getsockopt(socket_fd, SOL_LOCAL, LOCAL_PEERPID, pid,
- &((socklen_t) {sizeof(*pid)}));
+ return getsockopt(socket_fd, SOL_LOCAL, LOCAL_PEERPID, pid, &pid_len);
}
#elif defined(__sun__)