projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sessiond: main.cpp: iterate on list using list_iteration_adapter
[lttng-tools.git]
/
src
/
common
/
sessiond-comm
/
inet6.cpp
diff --git
a/src/common/sessiond-comm/inet6.cpp
b/src/common/sessiond-comm/inet6.cpp
index caa4d7eb3906b691d1762b6e0fd41268b0ff53ed..0d1b6f15ba02611024e61340f76f3027ae1d1011 100644
(file)
--- a/
src/common/sessiond-comm/inet6.cpp
+++ b/
src/common/sessiond-comm/inet6.cpp
@@
-6,24
+6,24
@@
*/
#define _LGPL_SOURCE
*/
#define _LGPL_SOURCE
+#include "inet6.hpp"
+
+#include <common/common.hpp>
+#include <common/compat/errno.hpp>
+#include <common/compat/time.hpp>
+#include <common/time.hpp>
+
+#include <fcntl.h>
#include <limits.h>
#include <limits.h>
+#include <poll.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
-#include <fcntl.h>
-#include <common/compat/time.hpp>
-#include <poll.h>
-
-#include <common/common.hpp>
-#include <common/time.hpp>
-#include <common/compat/errno.hpp>
-
-#include "inet6.hpp"
-#define RECONNECT_DELAY
200
/* ms */
+#define RECONNECT_DELAY
200
/* ms */
/*
* INET protocol operations.
/*
* INET protocol operations.
@@
-89,17
+89,15
@@
int lttcomm_bind_inet6_sock(struct lttcomm_sock *sock)
return bind(sock->fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr));
}
return bind(sock->fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr));
}
-static
-int connect_no_timeout(struct lttcomm_sock *sock)
+static int connect_no_timeout(struct lttcomm_sock *sock)
{
struct sockaddr_in6 sockaddr = sock->sockaddr.addr.sin6;
return connect(sock->fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr));
}
{
struct sockaddr_in6 sockaddr = sock->sockaddr.addr.sin6;
return connect(sock->fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr));
}
-static
-int connect_with_timeout(struct lttcomm_sock *sock)
+static int connect_with_timeout(struct lttcomm_sock *sock)
{
{
- unsigned long timeout = lttcomm_get_network_timeout();
+
const
unsigned long timeout = lttcomm_get_network_timeout();
int ret, flags, connect_ret;
struct timespec orig_time, cur_time;
unsigned long diff_ms;
int ret, flags, connect_ret;
struct timespec orig_time, cur_time;
unsigned long diff_ms;
@@
-127,8
+125,7
@@
int connect_with_timeout(struct lttcomm_sock *sock)
sockaddr = sock->sockaddr.addr.sin6;
connect_ret = connect(sock->fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr));
sockaddr = sock->sockaddr.addr.sin6;
connect_ret = connect(sock->fd, (struct sockaddr *) &sockaddr, sizeof(sockaddr));
- if (connect_ret == -1 && errno != EAGAIN && errno != EWOULDBLOCK &&
- errno != EINPROGRESS) {
+ if (connect_ret == -1 && errno != EAGAIN && errno != EWOULDBLOCK && errno != EINPROGRESS) {
goto error;
} else if (!connect_ret) {
/* Connect succeeded */
goto error;
} else if (!connect_ret) {
/* Connect succeeded */
@@
-136,7
+133,9
@@
int connect_with_timeout(struct lttcomm_sock *sock)
}
DBG("Asynchronous connect for sock %d, performing polling with"
}
DBG("Asynchronous connect for sock %d, performing polling with"
- " timeout: %lums", sock->fd, timeout);
+ " timeout: %lums",
+ sock->fd,
+ timeout);
/*
* Perform poll loop following EINPROGRESS recommendation from
/*
* Perform poll loop following EINPROGRESS recommendation from
@@
-161,8
+160,7
@@
int connect_with_timeout(struct lttcomm_sock *sock)
goto error;
}
/* got something */
goto error;
}
/* got something */
- ret = getsockopt(sock->fd, SOL_SOCKET,
- SO_ERROR, &optval, &optval_len);
+ ret = getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, &optval, &optval_len);
if (ret) {
PERROR("getsockopt");
goto error;
if (ret) {
PERROR("getsockopt");
goto error;
@@
-253,7
+251,7
@@
struct lttcomm_sock *lttcomm_accept_inet6_sock(struct lttcomm_sock *sock)
}
new_sock = lttcomm_alloc_sock(sock->proto);
}
new_sock = lttcomm_alloc_sock(sock->proto);
- if (new_sock ==
NULL
) {
+ if (new_sock ==
nullptr
) {
goto error;
}
goto error;
}
@@
-274,7
+272,7
@@
end:
error:
free(new_sock);
error:
free(new_sock);
- return
NULL
;
+ return
nullptr
;
}
/*
}
/*
@@
-310,8
+308,7
@@
end:
*
* Return the size of received data.
*/
*
* Return the size of received data.
*/
-ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf,
- size_t len, int flags)
+ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf, size_t len, int flags)
{
struct msghdr msg;
struct iovec iov[1];
{
struct msghdr msg;
struct iovec iov[1];
@@
-356,8
+353,8
@@
end:
*
* Return the size of sent data.
*/
*
* Return the size of sent data.
*/
-ssize_t
lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, const void *buf,
-
size_t len, int flags)
+ssize_t
+
lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, const void *buf,
size_t len, int flags)
{
struct msghdr msg;
struct iovec iov[1];
{
struct msghdr msg;
struct iovec iov[1];
This page took
0.024487 seconds
and
4
git commands to generate.