| 3123 | } |
| 3124 | |
| 3125 | static int stdio_stream_write(FILE *stream) |
| 3126 | { |
| 3127 | if (stream->buf == NULL) |
| 3128 | return 0; |
| 3129 | if (stream->write_ptr == NULL) |
| 3130 | { |
| 3131 | stream->write_ptr = stream->buf; |
| 3132 | stream->write_end = stream->buf + stream->bufsiz; |
| 3133 | return 0; |
| 3134 | } |
| 3135 | if (stdio_stream_write_buf(stream, stream->buf, stream->write_ptr) < 0) |
| 3136 | { |
| 3137 | stream->flags |= STDIO_FLAG_ERROR; |
| 3138 | return EOF; |
| 3139 | } |
| 3140 | stream->write_ptr = stream->buf; |
| 3141 | return 0; |
| 3142 | } |
| 3143 | |
| 3144 | static int fflush_unlocked(FILE *stream) |
| 3145 | { |
no test coverage detected