| 127 | static size_t wf_writeBufCnt; |
| 128 | |
| 129 | int flush_write_file(int f) |
| 130 | { |
| 131 | int ret = 0; |
| 132 | char *bp = wf_writeBuf; |
| 133 | |
| 134 | while (wf_writeBufCnt > 0) { |
| 135 | if ((ret = write(f, bp, wf_writeBufCnt)) < 0) { |
| 136 | if (errno == EINTR) |
| 137 | continue; |
| 138 | return ret; |
| 139 | } |
| 140 | wf_writeBufCnt -= ret; |
| 141 | bp += ret; |
| 142 | } |
| 143 | return ret; |
| 144 | } |
| 145 | |
| 146 | /* write_file does not allow incomplete writes. It loops internally |
| 147 | * until len bytes are written or errno is set. Note that use_seek and |
no outgoing calls
no test coverage detected