diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-27 19:45:43 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-10-27 19:45:43 (GMT) |
commit | ea5d17d9afd3e5eb9ab317665f9d28bd2d59d669 (patch) | |
tree | cbd77ba59f118cde82025dfdc3e6bf96185eb253 /Modules/_io/_iomodule.c | |
parent | d72402effcc3ab4dd8dbdfc1e6f12aebcf3d3e13 (diff) | |
download | cpython-ea5d17d9afd3e5eb9ab317665f9d28bd2d59d669.zip cpython-ea5d17d9afd3e5eb9ab317665f9d28bd2d59d669.tar.gz cpython-ea5d17d9afd3e5eb9ab317665f9d28bd2d59d669.tar.bz2 |
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.
Diffstat (limited to 'Modules/_io/_iomodule.c')
-rw-r--r-- | Modules/_io/_iomodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index c0c8154..44bdac6 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 |