Clean-up: sessiond: cmd_enable_channel_internal
[lttng-tools.git] / src / common / compat / poll.h
index 7dce4e6eb836c34f3337675bbb4bba722734bdd7..cc2aab8f8fa50abde12b95763a23d60d89efb264 100644 (file)
@@ -1,14 +1,13 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  *
- * SPDX-License-Identifier: GPL-2.0-only
+ * SPDX-License-Identifier: LGPL-2.1-only
  *
  */
 
 #ifndef _LTT_POLL_H
 #define _LTT_POLL_H
 
-#include <assert.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -74,8 +73,8 @@ struct compat_epoll_event {
 static inline int __lttng_epoll_get_prev_fd(struct lttng_poll_event *events,
                int index, uint32_t nb_fd)
 {
-       assert(events);
-       assert(index != nb_fd);
+       LTTNG_ASSERT(events);
+       LTTNG_ASSERT(index != nb_fd);
 
        if (index == 0 || nb_fd == 0) {
                return -1;
@@ -117,7 +116,7 @@ static inline int compat_glibc_epoll_create(int size, int flags)
         * fcntl(..).
         */
        int efd = epoll_create(size);
-       assert(fcntl(efd, F_SETFD, flags) != -1);
+       LTTNG_ASSERT(fcntl(efd, F_SETFD, flags) != -1);
        return efd;
 }
 #endif
@@ -236,7 +235,7 @@ enum {
        LPOLLRDBAND = POLLRDBAND,
        LPOLLWRNORM = POLLWRNORM,
        LPOLLWRBAND = POLLWRBAND,
-#if __linux__
+#ifdef __linux__
        LPOLLMSG = POLLMSG,
        LPOLLRDHUP = POLLRDHUP,
 #elif (defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__sun__) || defined(__APPLE__))
@@ -279,8 +278,8 @@ struct compat_poll_event {
 static inline int __lttng_poll_get_prev_fd(struct lttng_poll_event *events,
                int index, uint32_t nb_fd)
 {
-       assert(events);
-       assert(index != nb_fd);
+       LTTNG_ASSERT(events);
+       LTTNG_ASSERT(index != nb_fd);
 
        if (index == 0 || nb_fd == 0) {
                return -1;
@@ -355,7 +354,8 @@ extern int compat_poll_set_max_size(void);
 /*
  * No need to reset a pollfd structure for poll(2)
  */
-static inline void lttng_poll_reset(struct lttng_poll_event *events)
+static inline void lttng_poll_reset(
+               struct lttng_poll_event *events __attribute__((unused)))
 {}
 
 /*
This page took 0.024642 seconds and 4 git commands to generate.