When we have no setvbuf(), make the file totally unbuffered using
setbuf() if a buffer size of 0 or 1 byte is requested.
This commit is contained in:
@@ -165,7 +165,10 @@ PyFile_SetBufSize(f, bufsize)
|
||||
}
|
||||
setvbuf(((PyFileObject *)f)->f_fp, (char *)NULL,
|
||||
type, bufsize);
|
||||
#endif /* HAVE_SETVBUF */
|
||||
#else /* !HAVE_SETVBUF */
|
||||
if (bufsize <= 1)
|
||||
setbuf(((PyFileObject *)f)->f_fp, (char *)NULL);
|
||||
#endif /* !HAVE_SETVBUF */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user