From: Ian Jackson Subject: [PATCH 04/11] libxc: rump kernels: Use standard xc_osdep_get_info Date: Thu, 10 Jul 2014 17:14:33 +0100 Message-ID: <1405008880-21843-5-git-send-email-ian.jackson@eu.citrix.com> References: <1405008880-21843-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1405008880-21843-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Do not try to support the dlopen-based xc indirection. Introduce a local #define DO_DYNAMIC_OSDEP to centralise the condition. Add comments to the #endifs. Signed-off-by: Ian Jackson CC: Ian Campbell --- v2: Remove duplication by introducing DO_DYNAMIC_OSDEP. Add comments to the #endifs. --- tools/libxc/xc_private.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c index a3da614..1c214dd 100644 --- a/tools/libxc/xc_private.c +++ b/tools/libxc/xc_private.c @@ -33,6 +33,10 @@ #define XENCTRL_OSDEP "XENCTRL_OSDEP" +#if !defined (__MINIOS__) && !defined(__RUMPUSER_XEN__) +#define DO_DYNAMIC_OSDEP +#endif + /* * Returns a (shallow) copy of the xc_osdep_info_t for the * active OS interface. @@ -50,7 +54,7 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info) { int rc = -1; -#ifndef __MINIOS__ +#ifdef DO_DYNAMIC_OSDEP const char *lib = getenv(XENCTRL_OSDEP); xc_osdep_info_t *pinfo; void *dl_handle = NULL; @@ -86,7 +90,7 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info) info->dl_handle = dl_handle; } else -#endif +#endif /*DO_DYNAMIC_OSDEP*/ { *info = xc_osdep_info; info->dl_handle = NULL; @@ -94,21 +98,21 @@ static int xc_osdep_get_info(xc_interface *xch, xc_osdep_info_t *info) rc = 0; -#ifndef __MINIOS__ +#ifdef DO_DYNAMIC_OSDEP out: if ( dl_handle && rc == -1 ) dlclose(dl_handle); -#endif +#endif /*DO_DYNAMIC_OSDEP*/ return rc; } static void xc_osdep_put(xc_osdep_info_t *info) { -#ifndef __MINIOS__ +#ifdef DO_DYNAMIC_OSDEP if ( info->dl_handle ) dlclose(info->dl_handle); -#endif +#endif /*DO_DYNAMIC_OSDEP*/ } static const char *xc_osdep_type_name(enum xc_osdep_type type) -- 1.7.10.4