projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update version to v2.1.0-rc4
[lttng-tools.git]
/
src
/
common
/
sessiond-comm
/
inet.c
diff --git
a/src/common/sessiond-comm/inet.c
b/src/common/sessiond-comm/inet.c
index 51ac670f27256a1e7390661900aaf668543d3220..e8d3afef316696ebdef315e92e58870f5c784c52 100644
(file)
--- a/
src/common/sessiond-comm/inet.c
+++ b/
src/common/sessiond-comm/inet.c
@@
-47,9
+47,10
@@
static const struct lttcomm_proto_ops inet_ops = {
/*
* Creates an PF_INET socket.
*/
/*
* Creates an PF_INET socket.
*/
+__attribute__((visibility("hidden")))
int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type, int proto)
{
int lttcomm_create_inet_sock(struct lttcomm_sock *sock, int type, int proto)
{
- int val, ret;
+ int val
= 1
, ret;
/* Create server socket */
if ((sock->fd = socket(PF_INET, type, proto)) < 0) {
/* Create server socket */
if ((sock->fd = socket(PF_INET, type, proto)) < 0) {
@@
-77,6
+78,7
@@
error:
/*
* Bind socket and return.
*/
/*
* Bind socket and return.
*/
+__attribute__((visibility("hidden")))
int lttcomm_bind_inet_sock(struct lttcomm_sock *sock)
{
int ret;
int lttcomm_bind_inet_sock(struct lttcomm_sock *sock)
{
int ret;
@@
-93,6
+95,7
@@
int lttcomm_bind_inet_sock(struct lttcomm_sock *sock)
/*
* Connect PF_INET socket.
*/
/*
* Connect PF_INET socket.
*/
+__attribute__((visibility("hidden")))
int lttcomm_connect_inet_sock(struct lttcomm_sock *sock)
{
int ret, closeret;
int lttcomm_connect_inet_sock(struct lttcomm_sock *sock)
{
int ret, closeret;
@@
-122,6
+125,7
@@
error_connect:
* Do an accept(2) on the sock and return the new lttcomm socket. The socket
* MUST be bind(2) before.
*/
* Do an accept(2) on the sock and return the new lttcomm socket. The socket
* MUST be bind(2) before.
*/
+__attribute__((visibility("hidden")))
struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
{
int new_fd;
struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
{
int new_fd;
@@
-136,7
+140,7
@@
struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
goto end;
}
goto end;
}
- new_sock = lttcomm_alloc_sock(
LTTCOMM_INET,
sock->proto);
+ new_sock = lttcomm_alloc_sock(sock->proto);
if (new_sock == NULL) {
goto error;
}
if (new_sock == NULL) {
goto error;
}
@@
-150,6
+154,7
@@
struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
}
new_sock->fd = new_fd;
}
new_sock->fd = new_fd;
+ new_sock->ops = &inet_ops;
end:
return new_sock;
end:
return new_sock;
@@
-162,6
+167,7
@@
error:
/*
* Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
*/
/*
* Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
*/
+__attribute__((visibility("hidden")))
int lttcomm_listen_inet_sock(struct lttcomm_sock *sock, int backlog)
{
int ret;
int lttcomm_listen_inet_sock(struct lttcomm_sock *sock, int backlog)
{
int ret;
@@
-192,6
+198,7
@@
end:
*
* Return the size of received data.
*/
*
* Return the size of received data.
*/
+__attribute__((visibility("hidden")))
ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
size_t len, int flags)
{
ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
size_t len, int flags)
{
@@
-228,6
+235,7
@@
ssize_t lttcomm_recvmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
*
* Return the size of sent data.
*/
*
* Return the size of sent data.
*/
+__attribute__((visibility("hidden")))
ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
size_t len, int flags)
{
ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
size_t len, int flags)
{
@@
-270,17
+278,18
@@
ssize_t lttcomm_sendmsg_inet_sock(struct lttcomm_sock *sock, void *buf,
/*
* Shutdown cleanly and close.
*/
/*
* Shutdown cleanly and close.
*/
+__attribute__((visibility("hidden")))
int lttcomm_close_inet_sock(struct lttcomm_sock *sock)
{
int lttcomm_close_inet_sock(struct lttcomm_sock *sock)
{
- int ret
, closeret
;
+ int ret;
- /* Don't try to close an invalid mark socket */
+ /* Don't try to close an invalid mark
ed
socket */
if (sock->fd == -1) {
return 0;
}
if (sock->fd == -1) {
return 0;
}
-
close
ret = close(sock->fd);
- if (
close
ret) {
+ ret = close(sock->fd);
+ if (ret) {
PERROR("close inet");
}
PERROR("close inet");
}
This page took
0.024705 seconds
and
4
git commands to generate.