projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lttng: destroy: ensure a cmd_error_code is returned by the command
[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 adabebfaeb3ec176ccabcc12a12474a8be969203..289e19e98df67b3192095da8d4df50c4197b99cb 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.h>
-#include <poll.h>
-
-#include <common/common.h>
-#include <common/time.h>
-#include <common/compat/errno.h>
-
-#include "inet6.h"
-#define RECONNECT_DELAY
200
/* ms */
+#define RECONNECT_DELAY
200
/* ms */
/*
* INET protocol operations.
/*
* INET protocol operations.
@@
-89,15
+89,13
@@
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();
int ret, flags, connect_ret;
{
unsigned long timeout = lttcomm_get_network_timeout();
int ret, flags, connect_ret;
@@
-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.024557 seconds
and
4
git commands to generate.