From: Antoine Pitrou Date: Wed, 27 Oct 2010 19:45:43 +0000 (+0000) Subject: In open(), only set the buffer size from st.st_blksize when it is greater X-Git-Tag: v3.2a4~332 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea5d17d9afd3e5eb9ab317665f9d28bd2d59d669;p=thirdparty%2FPython%2Fcpython.git 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 c0c81546542b..44bdac6b5cf4 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