Cleanup: send_fds functions are not const-correct
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 May 2018 16:00:41 +0000 (12:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 8 May 2018 16:00:41 +0000 (12:00 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/consumer.h
src/common/unix.c
src/common/unix.h

index 44dc35d6b92e3fafd412e35fb95b838f986bb016..4a19c93475802af9e4e5f98a37325b1db207a7c4 100644 (file)
@@ -735,7 +735,8 @@ error:
  *
  * The consumer socket lock must be held by the caller.
  */
-int consumer_send_fds(struct consumer_socket *sock, int *fds, size_t nb_fd)
+int consumer_send_fds(struct consumer_socket *sock, const int *fds,
+               size_t nb_fd)
 {
        int ret;
 
@@ -973,7 +974,7 @@ void consumer_init_streams_sent_comm_msg(struct lttcomm_consumer_msg *msg,
  */
 int consumer_send_stream(struct consumer_socket *sock,
                struct consumer_output *dst, struct lttcomm_consumer_msg *msg,
-               int *fds, size_t nb_fd)
+               const int *fds, size_t nb_fd)
 {
        int ret;
 
index d875f2c6dda7aaa228235f5756cc061766a9c81e..b1189cc87b80c35bc1910501d4a5e9283fac37ad 100644 (file)
@@ -222,12 +222,13 @@ void consumer_output_get(struct consumer_output *obj);
 void consumer_output_put(struct consumer_output *obj);
 int consumer_set_network_uri(struct consumer_output *obj,
                struct lttng_uri *uri);
-int consumer_send_fds(struct consumer_socket *sock, int *fds, size_t nb_fd);
+int consumer_send_fds(struct consumer_socket *sock, const int *fds,
+               size_t nb_fd);
 int consumer_send_msg(struct consumer_socket *sock,
                struct lttcomm_consumer_msg *msg);
 int consumer_send_stream(struct consumer_socket *sock,
                struct consumer_output *dst, struct lttcomm_consumer_msg *msg,
-               int *fds, size_t nb_fd);
+               const int *fds, size_t nb_fd);
 int consumer_send_channel(struct consumer_socket *sock,
                struct lttcomm_consumer_msg *msg);
 int consumer_send_relayd_socket(struct consumer_socket *consumer_sock,
index 2f4df68e627bd37a0f6fc84fdfb868cc02de6bc1..41525b69170a2c10bfcbdf2401f22936e576d058 100644 (file)
@@ -374,7 +374,7 @@ int lttcomm_close_unix_sock(int sock)
  * Returns the size of data sent, or negative error value.
  */
 LTTNG_HIDDEN
-ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
+ssize_t lttcomm_send_fds_unix_sock(int sock, const int *fds, size_t nb_fd)
 {
        struct msghdr msg;
        struct cmsghdr *cmptr;
index 886b40e73fb320536b2d91cab6fa73ce164947dd..58038ffe5fbe1fc3a6e72e23ad2aa21d32f35241 100644 (file)
@@ -39,7 +39,7 @@ int lttcomm_close_unix_sock(int sock);
 
 /* Send a message accompanied by fd(s) over a unix socket. */
 LTTNG_HIDDEN
-ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd);
+ssize_t lttcomm_send_fds_unix_sock(int sock, const int *fds, size_t nb_fd);
 /* Recv a message accompanied by fd(s) from a unix socket */
 LTTNG_HIDDEN
 ssize_t lttcomm_recv_fds_unix_sock(int sock, int *fds, size_t nb_fd);
This page took 0.027801 seconds and 4 git commands to generate.