Handle operating systems that are anticipating the day when files should
be read in chunks > 2GB. svn path=/trunk/; revision=50847
This commit is contained in:
parent
c9e6eda769
commit
52972f605d
|
@ -815,7 +815,15 @@ file_fdopen(int fd)
|
|||
|
||||
#ifdef _STATBUF_ST_BLKSIZE
|
||||
if (fstat(fd, &st) >= 0) {
|
||||
want = st.st_blksize;
|
||||
/*
|
||||
* Yes, st_blksize can be bigger than an int; apparently,
|
||||
* it's a long on LP64 Linux, for example.
|
||||
*
|
||||
* If the value is too big to fit into an int, just
|
||||
* use the default.
|
||||
*/
|
||||
if (st.st_blksize <= G_MAXINT)
|
||||
want = (int)st.st_blksize;
|
||||
/* XXX, verify result? */
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue