From 70c9cb05ff145135737cf394de81f80191599d9c Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 28 Dec 2012 17:57:07 +0100 Subject: [PATCH] priv: open special call is only needed for Linux --- src/daemon/lldpd.h | 2 +- src/daemon/priv.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/daemon/lldpd.h b/src/daemon/lldpd.h index 1a042623..ea96dcf1 100644 --- a/src/daemon/lldpd.h +++ b/src/daemon/lldpd.h @@ -196,8 +196,8 @@ client_handle_client(struct lldpd *cfg, void priv_init(char*, int, uid_t, gid_t); void priv_ctl_cleanup(void); char *priv_gethostbyname(void); -int priv_open(char*); #ifdef HOST_OS_LINUX +int priv_open(char*); int priv_ethtool(char*, void*, size_t); #endif int priv_iface_init(int); diff --git a/src/daemon/priv.c b/src/daemon/priv.c index 73608aa3..7753b94a 100644 --- a/src/daemon/priv.c +++ b/src/daemon/priv.c @@ -115,6 +115,7 @@ priv_gethostbyname() return buf; } +#ifdef HOST_OS_LINUX /* Proxy for open */ int priv_open(char *file) @@ -130,6 +131,7 @@ priv_open(char *file) return rc; return receive_fd(remote); } +#endif #ifdef HOST_OS_LINUX /* Proxy for ethtool ioctl */ @@ -226,6 +228,7 @@ asroot_gethostbyname() } } +#ifdef HOST_OS_LINUX static void asroot_open() { @@ -283,6 +286,7 @@ asroot_open() send_fd(remote, fd); close(fd); } +#endif #ifdef HOST_OS_LINUX #include @@ -456,8 +460,8 @@ static struct dispatch_actions actions[] = { {PRIV_PING, asroot_ping}, {PRIV_DELETE_CTL_SOCKET, asroot_ctl_cleanup}, {PRIV_GET_HOSTNAME, asroot_gethostbyname}, - {PRIV_OPEN, asroot_open}, #ifdef HOST_OS_LINUX + {PRIV_OPEN, asroot_open}, {PRIV_ETHTOOL, asroot_ethtool}, #endif {PRIV_IFACE_INIT, asroot_iface_init}, -- 2.39.5