From: Antoine Pitrou Date: Wed, 27 Oct 2010 19:52:40 +0000 (+0000) Subject: Merged revisions 85864 via svnmerge from X-Git-Tag: v3.1.3rc1~84 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9acae51be2d9e17ecab3e174cb32dd05e1097c1f;p=thirdparty%2FPython%2Fcpython.git Merged revisions 85864 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85864 | antoine.pitrou | 2010-10-27 21:45:43 +0200 (mer., 27 oct. 2010) | 5 lines In open(), only set the buffer size from st.st_blksize when it is greater than 1. This matches the pure Python implementation in _pyio and should fix a couple of failures on the NetBSD buildbot. ........ --- diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index 733a7b95d725..a1c451eb5663 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -451,7 +451,7 @@ io_open(PyObject *self, PyObject *args, PyObject *kwds) if (fileno == -1 && PyErr_Occurred()) goto error; - if (fstat(fileno, &st) >= 0) + if (fstat(fileno, &st) >= 0 && st.st_blksize > 1) buffering = st.st_blksize; } #endif