Rev 4874 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4874 | Rev 4921 | ||
---|---|---|---|
Line 63... | Line 63... | ||
63 | /* Check if we are be called by asprintf family for initial buffer. */ |
63 | /* Check if we are be called by asprintf family for initial buffer. */ |
64 | if (fp->_flags & __SMBF) |
64 | if (fp->_flags & __SMBF) |
65 | size = _DEFAULT_ASPRINTF_BUFSIZE; |
65 | size = _DEFAULT_ASPRINTF_BUFSIZE; |
66 | else |
66 | else |
67 | size = BUFSIZ; |
67 | size = BUFSIZ; |
- | 68 | #ifdef _FSEEK_OPTIMIZATION |
|
68 | /* do not try to optimise fseek() */ |
69 | /* do not try to optimise fseek() */ |
69 | fp->_flags |= __SNPT; |
70 | fp->_flags |= __SNPT; |
- | 71 | #endif |
|
70 | } |
72 | } |
71 | else |
73 | else |
72 | { |
74 | { |
73 | couldbetty = (st.st_mode & S_IFMT) == S_IFCHR; |
75 | couldbetty = (st.st_mode & S_IFMT) == S_IFCHR; |
74 | #ifdef HAVE_BLKSIZE |
76 | #ifdef HAVE_BLKSIZE |
75 | size = st.st_blksize <= 0 ? BUFSIZ : st.st_blksize; |
77 | size = st.st_blksize <= 0 ? BUFSIZ : st.st_blksize; |
76 | #else |
78 | #else |
77 | size = BUFSIZ; |
79 | size = BUFSIZ; |
78 | #endif |
80 | #endif |
- | 81 | #ifdef _FSEEK_OPTIMIZATION |
|
79 | /* |
82 | /* |
80 | * Optimize fseek() only if it is a regular file. |
83 | * Optimize fseek() only if it is a regular file. |
81 | * (The test for __sseek is mainly paranoia.) |
84 | * (The test for __sseek is mainly paranoia.) |
82 | */ |
85 | */ |
83 | if ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek) |
86 | if ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek) |
Line 89... | Line 92... | ||
89 | fp->_blksize = 1024; |
92 | fp->_blksize = 1024; |
90 | #endif |
93 | #endif |
91 | } |
94 | } |
92 | else |
95 | else |
93 | fp->_flags |= __SNPT; |
96 | fp->_flags |= __SNPT; |
- | 97 | #endif |
|
94 | } |
98 | } |
95 | if ((p = _malloc_r (ptr, size)) == NULL) |
99 | if ((p = _malloc_r (ptr, size)) == NULL) |
96 | { |
100 | { |
97 | if (!(fp->_flags & __SSTR)) |
101 | if (!(fp->_flags & __SSTR)) |
98 | { |
102 | { |