diff -r 3c0ba3169733 Modules/_csv.c --- a/Modules/_csv.c Mon Aug 22 11:48:24 2011 +1000 +++ b/Modules/_csv.c Mon Aug 22 13:52:26 2011 +1000 @@ -534,8 +534,7 @@ return 0; } self->field_size *= 2; - self->field = PyMem_Resize(self->field, Py_UNICODE, - self->field_size); + PyMem_Resize(self->field, Py_UNICODE, self->field_size); } if (self->field == NULL) { PyErr_NoMemory(); @@ -1055,8 +1054,7 @@ Py_UNICODE* old_rec = self->rec; self->rec_size = (rec_len / MEM_INCR + 1) * MEM_INCR; - self->rec = PyMem_Resize(self->rec, Py_UNICODE, - self->rec_size); + PyMem_Resize(self->rec, Py_UNICODE, self->rec_size); if (self->rec == NULL) PyMem_Free(old_rec); } diff -r 3c0ba3169733 Modules/_sre.c --- a/Modules/_sre.c Mon Aug 22 11:48:24 2011 +1000 +++ b/Modules/_sre.c Mon Aug 22 13:52:26 2011 +1000 @@ -2963,13 +2963,13 @@ <1=skip> <2=flags> <3=min> <4=max>; If SRE_INFO_PREFIX or SRE_INFO_CHARSET is in the flags, more follows. */ - SRE_CODE flags, min, max, i; + SRE_CODE flags, i; SRE_CODE *newcode; GET_SKIP; newcode = code+skip-1; GET_ARG; flags = arg; - GET_ARG; min = arg; - GET_ARG; max = arg; + GET_ARG; /* min; not validated */ + GET_ARG; /* max; not validated */ /* Check that only valid flags are present */ if ((flags & ~(SRE_INFO_PREFIX | SRE_INFO_LITERAL | @@ -2985,9 +2985,9 @@ FAIL; /* Validate the prefix */ if (flags & SRE_INFO_PREFIX) { - SRE_CODE prefix_len, prefix_skip; + SRE_CODE prefix_len; GET_ARG; prefix_len = arg; - GET_ARG; prefix_skip = arg; + GET_ARG; /* prefix_skip; not validated */ /* Here comes the prefix string */ if (code+prefix_len < code || code+prefix_len > newcode) FAIL; diff -r 3c0ba3169733 Modules/socketmodule.c --- a/Modules/socketmodule.c Mon Aug 22 11:48:24 2011 +1000 +++ b/Modules/socketmodule.c Mon Aug 22 13:52:26 2011 +1000 @@ -3388,8 +3388,18 @@ #if defined(HAVE_GETHOSTBYNAME_R_6_ARG) result = gethostbyname_r(name, &hp_allocated, buf, buf_len, &h, &errnop); + /* gethostbyname_r doesn't promise to set h_errno (though it seems to on + Linux), so we raise the error from here. */ + if (result < 0) { + set_herror(errnop); + goto finally; + } #elif defined(HAVE_GETHOSTBYNAME_R_5_ARG) h = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop); + if (!h) { + set_herror(errnop); + goto finally; + } #else /* HAVE_GETHOSTBYNAME_R_3_ARG */ memset((void *) &data, '\0', sizeof(data)); result = gethostbyname_r(name, &hp_allocated, &data); @@ -3489,9 +3499,17 @@ result = gethostbyaddr_r(ap, al, af, &hp_allocated, buf, buf_len, &h, &errnop); + if (result < 0) { + set_herror(errnop); + goto finally; + } #elif defined(HAVE_GETHOSTBYNAME_R_5_ARG) h = gethostbyaddr_r(ap, al, af, &hp_allocated, buf, buf_len, &errnop); + if (!h) { + set_herror(errnop); + goto finally; + } #else /* HAVE_GETHOSTBYNAME_R_3_ARG */ memset((void *) &data, '\0', sizeof(data)); result = gethostbyaddr_r(ap, al, af, &hp_allocated, &data); diff -r 3c0ba3169733 Modules/tkappinit.c --- a/Modules/tkappinit.c Mon Aug 22 11:48:24 2011 +1000 +++ b/Modules/tkappinit.c Mon Aug 22 13:52:26 2011 +1000 @@ -128,6 +128,8 @@ Tcl_CreateCommand(interp, "tributton", triButtonCmd, (ClientData) main_window, NULL); } +#else + (void) main_window; #endif #ifdef WITH_PIL /* 0.2b5 and later -- not yet released as of May 14 */ diff -r 3c0ba3169733 Python/thread_pthread.h --- a/Python/thread_pthread.h Mon Aug 22 11:48:24 2011 +1000 +++ b/Python/thread_pthread.h Mon Aug 22 13:52:26 2011 +1000 @@ -306,6 +306,7 @@ status = sem_destroy(thelock); CHECK_STATUS("sem_destroy"); + (void) error; free((void *)thelock); } @@ -362,7 +363,9 @@ } } - if (status == 0) { + if (error) { + success = PY_LOCK_FAILURE; + } else if (status == 0) { success = PY_LOCK_ACQUIRED; } else if (intr_flag && status == EINTR) { success = PY_LOCK_INTR; @@ -385,6 +388,7 @@ status = sem_post(thelock); CHECK_STATUS("sem_post"); + (void) error; } #else /* USE_SEMAPHORES */ diff -r 3c0ba3169733 setup.py --- a/setup.py Mon Aug 22 11:48:24 2011 +1000 +++ b/setup.py Mon Aug 22 13:52:26 2011 +1000 @@ -1381,9 +1381,10 @@ # End multiprocessing # Platform-specific libraries - if (platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6', + if (platform in ('freebsd4', 'freebsd5', 'freebsd6', 'freebsd7', 'freebsd8') - or platform.startswith("gnukfreebsd")): + or platform.startswith("gnukfreebsd") + or platform.startswith("linux")): exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) ) else: missing.append('ossaudiodev')