actually, let's just completely remove it

This commit is contained in:
Alcaro 2017-12-04 13:30:38 +01:00 committed by GitHub
parent 89f7afdc8f
commit df55e6b4d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,7 +170,6 @@ void filestream_set_size(RFILE *stream)
**/ **/
RFILE *filestream_open(const char *path, unsigned mode, ssize_t unused) RFILE *filestream_open(const char *path, unsigned mode, ssize_t unused)
{ {
ssize_t bufsize = 0x4000;
int flags = 0; int flags = 0;
int mode_int = 0; int mode_int = 0;
#if defined(HAVE_BUFFERED_IO) #if defined(HAVE_BUFFERED_IO)
@ -191,7 +190,6 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t unused)
(void)mode_int; (void)mode_int;
(void)flags; (void)flags;
(void)bufsize;
stream->hints = mode; stream->hints = mode;
@ -298,8 +296,6 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t unused)
if (!stream->fp) if (!stream->fp)
goto error; goto error;
if (bufsize > 0)
{
/* Regarding setvbuf: /* Regarding setvbuf:
* *
* https://www.freebsd.org/cgi/man.cgi?query=setvbuf&apropos=0&sektion=0&manpath=FreeBSD+11.1-RELEASE&arch=default&format=html * https://www.freebsd.org/cgi/man.cgi?query=setvbuf&apropos=0&sektion=0&manpath=FreeBSD+11.1-RELEASE&arch=default&format=html
@ -309,9 +305,8 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t unused)
* *
* Since C89 does not support specifying a null buffer with a non-zero size, we create and track our own buffer for it. * Since C89 does not support specifying a null buffer with a non-zero size, we create and track our own buffer for it.
*/ */
stream->buf = (char*)calloc(1, bufsize); stream->buf = (char*)calloc(1, 0x4000);
setvbuf(stream->fp, stream->buf, _IOFBF, bufsize); setvbuf(stream->fp, stream->buf, _IOFBF, 0x4000);
}
} }
else else
#endif #endif