]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
priv: open special call is only needed for Linux
authorVincent Bernat <vincent.bernat@dailymotion.com>
Fri, 28 Dec 2012 16:57:07 +0000 (17:57 +0100)
committerVincent Bernat <vincent.bernat@dailymotion.com>
Fri, 28 Dec 2012 16:57:07 +0000 (17:57 +0100)
src/daemon/lldpd.h
src/daemon/priv.c

index 1a042623d5747b2a72f65e5dddc1ad4656c1b0a3..ea96dcf1cfb53f8b2103e0c93bb344338a124c45 100644 (file)
@@ -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);
index 73608aa378492b35f66dd6a46a01d086cf8968b8..7753b94a9c2e52b86a92b95e5a09b94a4ff1479a 100644 (file)
@@ -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 <linux/ethtool.h>
@@ -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},