Files
haikuports/dev-python/twisted/patches/python_twisted-13.2.0.patchset
2014-06-20 05:37:54 +00:00

60 lines
2.1 KiB
Plaintext

From 74c88f321a48ca64852eb22200712fc97eb2af33 Mon Sep 17 00:00:00 2001
From: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Date: Fri, 20 Jun 2014 04:57:11 +0000
Subject: sendmsg.c: fix compiling with gcc2.
diff --git a/twisted/python/sendmsg.c b/twisted/python/sendmsg.c
index 9f2fd8c..265003a 100644
--- a/twisted/python/sendmsg.c
+++ b/twisted/python/sendmsg.c
@@ -175,9 +175,11 @@ static PyObject *sendmsg_sendmsg(PyObject *self, PyObject *args, PyObject *keywd
int fd;
int flags = 0;
+ size_t all_data_len = 0;
Py_ssize_t sendmsg_result, iovec_length;
struct msghdr message_header;
- struct iovec iov[1];
+ struct iovec iov[1];
+ struct cmsghdr *control_message = NULL;
PyObject *ancillary = NULL;
PyObject *iterator = NULL;
PyObject *item = NULL;
@@ -223,7 +225,7 @@ static PyObject *sendmsg_sendmsg(PyObject *self, PyObject *args, PyObject *keywd
goto finished;
}
- size_t all_data_len = 0;
+ all_data_len = 0;
/* First we need to know how big the buffer needs to be in order to
have enough space for all of the messages. */
@@ -290,7 +292,7 @@ static PyObject *sendmsg_sendmsg(PyObject *self, PyObject *args, PyObject *keywd
}
/* Unpack the tuples into the control message. */
- struct cmsghdr *control_message = CMSG_FIRSTHDR(&message_header);
+ control_message = CMSG_FIRSTHDR(&message_header);
while ( (item = PyIter_Next(iterator)) ) {
int type, level;
Py_ssize_t data_len;
@@ -497,12 +499,13 @@ static PyObject *sendmsg_recvmsg(PyObject *self, PyObject *args, PyObject *keywd
static PyObject *sendmsg_getsockfam(PyObject *self, PyObject *args,
PyObject *keywds) {
int fd;
+ socklen_t sz;
struct sockaddr sa;
static char *kwlist[] = {"fd", NULL};
if (!PyArg_ParseTupleAndKeywords(args, keywds, "i", kwlist, &fd)) {
return NULL;
}
- socklen_t sz = sizeof(sa);
+ sz = sizeof(sa);
if (getsockname(fd, &sa, &sz)) {
PyErr_SetFromErrno(sendmsg_socket_error);
return NULL;
--
1.8.3.4