summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2009-08-24 17:12:38 +0200
committerDavid Sommerseth <davids@redhat.com>2009-08-24 17:12:38 +0200
commit8a752483fd0ec7dea950ed577cd084a21efc74e8 (patch)
treedd4fa903e176257cf3dafdf694cb07b743ef509a
parent951f87eafc78a3376fa9ff2880926cbe7a1d0967 (diff)
downloadpython-ethtool-8a752483fd0ec7dea950ed577cd084a21efc74e8.tar.gz
python-ethtool-8a752483fd0ec7dea950ed577cd084a21efc74e8.tar.xz
python-ethtool-8a752483fd0ec7dea950ed577cd084a21efc74e8.zip
Fixed typos, more clean up
-rw-r--r--python-ethtool/etherinfo.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/python-ethtool/etherinfo.c b/python-ethtool/etherinfo.c
index d3ed377..fe24454 100644
--- a/python-ethtool/etherinfo.c
+++ b/python-ethtool/etherinfo.c
@@ -15,6 +15,7 @@
* General Public License for more details.
*/
+#include <Python.h>
#include <bits/sockaddr.h>
#include <stdio.h>
#include <string.h>
@@ -50,7 +51,7 @@ inline struct etherinfo *new_etherinfo_record()
{
struct etherinfo *ptr;
- ptr = (struct etherinfo *) malloc(sizeof(struct etherinfo)+1);
+ ptr = malloc(sizeof(struct etherinfo)+1);
if( ptr ) {
memset(ptr, 0, sizeof(struct etherinfo)+1);
}
@@ -132,12 +133,12 @@ int open_netlink_socket(struct sockaddr_nl *local)
fd = socket(local->nl_family, SOCK_RAW, NETLINK_ROUTE);
if(fd < 0) {
- PyErr_SetString(PuExc_OSError, strerror(errno));
+ PyErr_SetString(PyExc_OSError, strerror(errno));
return -1;
}
if(bind(fd, (struct sockaddr*) local, sizeof(*local)) < 0) {
- PyErr_SetString(PuExc_OSError, strerror(errno));
+ PyErr_SetString(PyExc_OSError, strerror(errno));
return -1;
}
@@ -177,7 +178,7 @@ int send_netlink_query(int fd, int get_type)
msg_info.msg_iovlen = 1;
if( sendmsg(fd, &msg_info, 0) < 0 ) {
- PyErr_SetString(PuExc_OSError, strerror(errno));
+ PyErr_SetString(PyExc_OSError, strerror(errno));
return 0;
}
return 1;
@@ -215,7 +216,7 @@ int read_netlink_results(int fd, struct sockaddr_nl *local,
if (status < 0) {
if (errno == EINTR || errno == EAGAIN)
continue;
- PyErr_SetString(PuExc_OSError, strerror(errno));
+ PyErr_SetString(PyExc_OSError, strerror(errno));
return 0;
}
@@ -242,7 +243,7 @@ int read_netlink_results(int fd, struct sockaddr_nl *local,
fprintf(stderr, "** ERROR ** Error message truncated\n");
} else {
errno = -err->error;
- PyErr_SetString(PuExc_OSError, strerror(errno));
+ PyErr_SetString(PyExc_OSError, strerror(errno));
}
return 0;
}