[Chris West]
> The package fails to build:

I had a look, and fixed the few compiler warnings and errors with gcc
5.  See the attached patch for the fixes.

-- 
Happy hacking
Petter Reinholdtsen
Description: Fix build problems discovered with gcc 5.
 * Add missing function prototype to get_nlc().
 * Add missing <net/if.h> include.
 * Remove unused and usless use of err variable.
Author: Petter Reinholdtsen <p...@hungry.com>
Forwarded: no
Reviewed-By: Petter Reinholdtsen <p...@hungry.com>
Last-Update: 2015-09-20

--- python-ethtool-0.11.orig/python-ethtool/etherinfo.h
+++ python-ethtool-0.11/python-ethtool/etherinfo.h
@@ -23,7 +23,7 @@ int get_etherinfo_link(PyEtherInfo *data
 PyObject * get_etherinfo_address(PyEtherInfo *self, nlQuery query);
 
 int open_netlink(PyEtherInfo *);
-struct nl_sock * get_nlc();
+struct nl_sock * get_nlc(void);
 void close_netlink(PyEtherInfo *);
 
 #endif
--- python-ethtool-0.11.orig/python-ethtool/netlink.c
+++ python-ethtool-0.11/python-ethtool/netlink.c
@@ -85,7 +85,7 @@ int open_netlink(PyEtherInfo *ethi)
  *
  * @returns Returns a pointer to a NETLINK connection libnl functions can use
  */
-struct nl_sock * get_nlc()
+struct nl_sock * get_nlc(void)
 {
 	assert(nlconnection);
 	return nlconnection;
--- python-ethtool-0.11.orig/python-ethtool/ethtool.c
+++ python-ethtool-0.11/python-ethtool/ethtool.c
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <ifaddrs.h>
 #include <netlink/route/addr.h>
+#include <net/if.h>
 
 #include "etherinfo_struct.h"
 #include "etherinfo_obj.h"
@@ -516,7 +517,7 @@ static int send_command(int cmd, const c
 	eval->cmd = cmd;
 
 	/* Open control socket. */
-	fd = socket(AF_INET, SOCK_DGRAM, 0), err;
+	fd = socket(AF_INET, SOCK_DGRAM, 0);
 	if (fd < 0) {
 		PyErr_SetFromErrno(PyExc_OSError);
 		return -1;

Reply via email to