Rev 1693 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1693 | Rev 3065 | ||
---|---|---|---|
Line 100... | Line 100... | ||
100 | /* |
100 | /* |
101 | * Before reading from a line buffered or unbuffered file, |
101 | * Before reading from a line buffered or unbuffered file, |
102 | * flush all line buffered output files, per the ANSI C |
102 | * flush all line buffered output files, per the ANSI C |
103 | * standard. |
103 | * standard. |
104 | */ |
104 | */ |
105 | - | ||
106 | if (fp->_flags & (__SLBF | __SNBF)) |
105 | if (fp->_flags & (__SLBF | __SNBF)) |
- | 106 | { |
|
- | 107 | /* Ignore this file in _fwalk to avoid potential deadlock. */ |
|
- | 108 | short orig_flags = fp->_flags; |
|
- | 109 | fp->_flags = 1; |
|
107 | _CAST_VOID _fwalk (_GLOBAL_REENT, lflush); |
110 | _CAST_VOID _fwalk (_GLOBAL_REENT, lflush); |
- | 111 | fp->_flags = orig_flags; |
|
- | 112 | ||
- | 113 | /* Now flush this file without locking it. */ |
|
- | 114 | if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR)) |
|
- | 115 | __sflush_r (ptr, fp); |
|
- | 116 | } |
|
- | 117 | ||
108 | fp->_p = fp->_bf._base; |
118 | fp->_p = fp->_bf._base; |
109 | fp->_r = fp->_read (ptr, fp->_cookie, (char *) fp->_p, fp->_bf._size); |
119 | fp->_r = fp->_read (ptr, fp->_cookie, (char *) fp->_p, fp->_bf._size); |
110 | #ifndef __CYGWIN__ |
120 | #ifndef __CYGWIN__ |
111 | if (fp->_r <= 0) |
121 | if (fp->_r <= 0) |
112 | #else |
122 | #else |