The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6323

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 0910a4a4613d5340aaacfc2e4bd10d14bbd6daf4 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Mon, 21 Oct 2019 15:35:23 +0200
Subject: [PATCH] unixfd: hide symbols

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 lxd/include/compiler.h             |  4 ++++
 shared/netutils/netns_getifaddrs.c |  4 +++-
 shared/netutils/unixfd.h           | 21 +++++++++++++--------
 3 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/lxd/include/compiler.h b/lxd/include/compiler.h
index 65457cb31b..2be62d6eb3 100644
--- a/lxd/include/compiler.h
+++ b/lxd/include/compiler.h
@@ -59,6 +59,10 @@
 #      define __hot __attribute__((hot))
 #endif
 
+#ifndef __hidden
+#      define __hidden __attribute__((visibility("hidden")))
+#endif
+
 #define __cgfsng_ops
 
 #endif /* __LXC_COMPILER_H */
diff --git a/shared/netutils/netns_getifaddrs.c 
b/shared/netutils/netns_getifaddrs.c
index 7487b13621..8db051a4d3 100644
--- a/shared/netutils/netns_getifaddrs.c
+++ b/shared/netutils/netns_getifaddrs.c
@@ -1,6 +1,8 @@
 // +build none
 
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
 #include <arpa/inet.h>
 #include <errno.h>
 #include <linux/if.h>
diff --git a/shared/netutils/unixfd.h b/shared/netutils/unixfd.h
index 5aa3fc9a53..64234869bb 100644
--- a/shared/netutils/unixfd.h
+++ b/shared/netutils/unixfd.h
@@ -1,20 +1,25 @@
 // +build linux
 // +build cgo
-//
+
 #ifndef LXD_UNIXFD_H
 #define LXD_UNIXFD_H
 
 #include <sys/socket.h>
 #include <sys/types.h>
 
-extern int lxc_abstract_unix_send_fds(int fd, int *sendfds, int num_sendfds,
-                                     void *data, size_t size);
+#include "../../lxd/include/compiler.h"
+
+__hidden extern int lxc_abstract_unix_send_fds(int fd, int *sendfds,
+                                              int num_sendfds, void *data,
+                                              size_t size);
 
-extern ssize_t lxc_abstract_unix_recv_fds_iov(int fd, int *recvfds,
-                                             int num_recvfds,
-                                             struct iovec *iov, size_t iovlen);
+__hidden extern ssize_t lxc_abstract_unix_recv_fds_iov(int fd, int *recvfds,
+                                                      int num_recvfds,
+                                                      struct iovec *iov,
+                                                      size_t iovlen);
 
-extern ssize_t lxc_abstract_unix_recv_fds(int fd, int *recvfds, int 
num_recvfds,
-                                         void *data, size_t size);
+__hidden extern ssize_t lxc_abstract_unix_recv_fds(int fd, int *recvfds,
+                                                  int num_recvfds, void *data,
+                                                  size_t size);
 
 #endif // LXD_UNIXFD_H
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to