Rev 1906 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1906 | Rev 3065 | ||
---|---|---|---|
Line 144... | Line 144... | ||
144 | if ((resid = count * size) == 0) |
144 | if ((resid = count * size) == 0) |
145 | return 0; |
145 | return 0; |
Line 146... | Line 146... | ||
146 | 146 | ||
Line 147... | Line -... | ||
147 | CHECK_INIT(ptr, fp); |
- | |
148 | 147 | CHECK_INIT(ptr, fp); |
|
149 | __sfp_lock_acquire (); |
148 | |
150 | _flockfile (fp); |
149 | _flockfile (fp); |
151 | ORIENT (fp, -1); |
150 | ORIENT (fp, -1); |
152 | if (fp->_r < 0) |
151 | if (fp->_r < 0) |
Line 195... | Line 194... | ||
195 | { |
194 | { |
196 | #ifdef __SCLE |
195 | #ifdef __SCLE |
197 | if (fp->_flags & __SCLE) |
196 | if (fp->_flags & __SCLE) |
198 | { |
197 | { |
199 | _funlockfile (fp); |
198 | _funlockfile (fp); |
200 | __sfp_lock_release (); |
- | |
201 | return crlf_r (ptr, fp, buf, total-resid, 1) / size; |
199 | return crlf_r (ptr, fp, buf, total-resid, 1) / size; |
202 | } |
200 | } |
203 | #endif |
201 | #endif |
204 | _funlockfile (fp); |
202 | _funlockfile (fp); |
205 | __sfp_lock_release (); |
- | |
206 | return (total - resid) / size; |
203 | return (total - resid) / size; |
207 | } |
204 | } |
208 | } |
205 | } |
209 | } |
206 | } |
210 | else |
207 | else |
Line 222... | Line 219... | ||
222 | /* no more input: return partial result */ |
219 | /* no more input: return partial result */ |
223 | #ifdef __SCLE |
220 | #ifdef __SCLE |
224 | if (fp->_flags & __SCLE) |
221 | if (fp->_flags & __SCLE) |
225 | { |
222 | { |
226 | _funlockfile (fp); |
223 | _funlockfile (fp); |
227 | __sfp_lock_release (); |
- | |
228 | return crlf_r (ptr, fp, buf, total-resid, 1) / size; |
224 | return crlf_r (ptr, fp, buf, total-resid, 1) / size; |
229 | } |
225 | } |
230 | #endif |
226 | #endif |
231 | _funlockfile (fp); |
227 | _funlockfile (fp); |
232 | __sfp_lock_release (); |
- | |
233 | return (total - resid) / size; |
228 | return (total - resid) / size; |
234 | } |
229 | } |
235 | } |
230 | } |
236 | _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, resid); |
231 | _CAST_VOID memcpy ((_PTR) p, (_PTR) fp->_p, resid); |
237 | fp->_r -= resid; |
232 | fp->_r -= resid; |
Line 241... | Line 236... | ||
241 | /* Perform any CR/LF clean-up if necessary. */ |
236 | /* Perform any CR/LF clean-up if necessary. */ |
242 | #ifdef __SCLE |
237 | #ifdef __SCLE |
243 | if (fp->_flags & __SCLE) |
238 | if (fp->_flags & __SCLE) |
244 | { |
239 | { |
245 | _funlockfile (fp); |
240 | _funlockfile (fp); |
246 | __sfp_lock_release (); |
- | |
247 | return crlf_r(ptr, fp, buf, total, 0) / size; |
241 | return crlf_r(ptr, fp, buf, total, 0) / size; |
248 | } |
242 | } |
249 | #endif |
243 | #endif |
250 | _funlockfile (fp); |
244 | _funlockfile (fp); |
251 | __sfp_lock_release (); |
- | |
252 | return count; |
245 | return count; |
253 | } |
246 | } |
Line 254... | Line 247... | ||
254 | 247 | ||
255 | #ifndef _REENT_ONLY |
248 | #ifndef _REENT_ONLY |