From a7692df573ffd5a69eb086ac9e457c6bda961edb Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 20 Jul 2020 17:22:31 +0200 Subject: [PATCH] lxclock: hide unnecessary symbols Signed-off-by: Christian Brauner --- src/lxc/compiler.h | 4 ++++ src/lxc/lxclock.h | 22 ++++++++++++---------- src/tests/Makefile.am | 7 ++++++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/lxc/compiler.h b/src/lxc/compiler.h index 1852f1c0a..c230e510c 100644 --- a/src/lxc/compiler.h +++ b/src/lxc/compiler.h @@ -79,4 +79,8 @@ #define __hidden __attribute__((visibility("hidden"))) #endif +#ifndef __public +#define __public __attribute__((visibility("default"))) +#endif + #endif /* __LXC_COMPILER_H */ diff --git a/src/lxc/lxclock.h b/src/lxc/lxclock.h index 9f9bc3bf6..38f49b5b4 100644 --- a/src/lxc/lxclock.h +++ b/src/lxc/lxclock.h @@ -11,6 +11,8 @@ #include #include +#include "compiler.h" + #ifndef F_OFD_GETLK #define F_OFD_GETLK 36 #endif @@ -71,7 +73,7 @@ struct lxc_lock { * freed when the container is freed), and \c u.f.fd = -1. * */ -extern struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name); +__hidden extern struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name); /*! * \brief Take an existing lock. @@ -89,7 +91,7 @@ extern struct lxc_lock *lxc_newlock(const char *lxcpath, const char *name); * (except in the test case) I may remove the support for it in sem as * well. */ -extern int lxclock(struct lxc_lock *lock, int timeout); +__hidden extern int lxclock(struct lxc_lock *lock, int timeout); /*! * \brief Unlock specified lock previously locked using \ref lxclock(). @@ -99,24 +101,24 @@ extern int lxclock(struct lxc_lock *lock, int timeout); * \return \c 0 on success, \c -2 if provided lock was not already held, * otherwise \c -1 with \c errno saved from \c fcntl(2) or sem_post function. */ -extern int lxcunlock(struct lxc_lock *lock); +__hidden extern int lxcunlock(struct lxc_lock *lock); /*! * \brief Free a lock created by \ref lxc_newlock(). * * \param lock Lock. */ -extern void lxc_putlock(struct lxc_lock *lock); +__hidden extern void lxc_putlock(struct lxc_lock *lock); /*! * \brief Lock the current process. */ -extern void process_lock(void); +__hidden extern void process_lock(void); /*! * \brief Unlock the current process. */ -extern void process_unlock(void); +__hidden extern void process_unlock(void); struct lxc_container; @@ -127,14 +129,14 @@ struct lxc_container; * * \return As for \ref lxclock(). */ -extern int container_mem_lock(struct lxc_container *c); +__hidden extern int container_mem_lock(struct lxc_container *c); /*! * \brief Unlock the containers memory. * * \param c Container. */ -extern void container_mem_unlock(struct lxc_container *c); +__hidden extern void container_mem_unlock(struct lxc_container *c); /*! * \brief Lock the containers disk data. @@ -144,7 +146,7 @@ extern void container_mem_unlock(struct lxc_container *c); * \return \c 0 on success, or an \ref lxclock() error return * values on error. */ -extern int container_disk_lock(struct lxc_container *c); +__hidden extern int container_disk_lock(struct lxc_container *c); /*! * \brief Unlock the containers disk data. @@ -152,6 +154,6 @@ extern int container_disk_lock(struct lxc_container *c); * \param c Container. * */ -extern void container_disk_unlock(struct lxc_container *c); +__hidden extern void container_disk_unlock(struct lxc_container *c); #endif diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index cf1447b52..8c84c1d2b 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -74,7 +74,12 @@ lxc_test_device_add_remove_SOURCES = device_add_remove.c lxc_test_getkeys_SOURCES = getkeys.c lxc_test_get_item_SOURCES = get_item.c lxc_test_list_SOURCES = list.c -lxc_test_locktests_SOURCES = locktests.c +lxc_test_locktests_SOURCES = locktests.c \ + ../lxc/caps.c ../lxc/caps.h \ + ../lxc/file_utils.c ../lxc/file_utils.h \ + ../lxc/log.c ../lxc/log.h \ + ../lxc/lxclock.c ../lxc/lxclock.h \ + ../lxc/string_utils.c ../lxc/string_utils.h lxc_test_lxcpath_SOURCES = lxcpath.c lxc_test_may_control_SOURCES = may_control.c lxc_test_mount_injection_SOURCES = mount_injection.c \ -- 2.47.2