Fix: time redefinition warnings on macOS builds
[lttng-tools.git] / src / common / sessiond-comm / inet.c
index 35ce3b6b5c9ca2a720a509d3d95aa172931a221a..25dbd2195a9f936721fc158a7c94d29234d9206c 100644 (file)
 #include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <time.h>
+#include <common/compat/time.h>
 #include <poll.h>
 
 #include <common/common.h>
+#include <common/time.h>
 
 #include "inet.h"
 
-#define MSEC_PER_SEC   1000
-#define NSEC_PER_MSEC  1000000
 #define RECONNECT_DELAY        200     /* ms */
 
 /*
@@ -159,7 +158,7 @@ int connect_with_timeout(struct lttcomm_sock *sock)
                return -1;
        }
 
-       ret = clock_gettime(CLOCK_MONOTONIC, &orig_time);
+       ret = lttng_clock_gettime(CLOCK_MONOTONIC, &orig_time);
        if (ret == -1) {
                PERROR("clock_gettime");
                return -1;
@@ -213,7 +212,7 @@ int connect_with_timeout(struct lttcomm_sock *sock)
                        }
                }
                /* ret == 0: timeout */
-               ret = clock_gettime(CLOCK_MONOTONIC, &cur_time);
+               ret = lttng_clock_gettime(CLOCK_MONOTONIC, &cur_time);
                if (ret == -1) {
                        PERROR("clock_gettime");
                        connect_ret = ret;
@@ -407,7 +406,7 @@ ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
  * Return the size of sent data.
  */
 LTTNG_HIDDEN
-ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
+ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, const void *buf,
                size_t len, int flags)
 {
        struct msghdr msg;
@@ -416,7 +415,7 @@ ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
 
        memset(&msg, 0, sizeof(msg));
 
-       iov[0].iov_base = buf;
+       iov[0].iov_base = (void *) buf;
        iov[0].iov_len = len;
        msg.msg_iov = iov;
        msg.msg_iovlen = 1;
This page took 0.024304 seconds and 4 git commands to generate.