diff options
author | Joe Orton <jorton@apache.org> | 2005-08-20 09:32:35 +0000 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2005-08-20 09:32:35 +0000 |
commit | 5fb06021bf1d8435b651cd2be3b8a97d6cd25d71 (patch) | |
tree | de724405677c88ee3ca6883f27f8e562d50915b5 /file_io/unix | |
parent | 4d0ac2243b1ae16a7b08e70db8f7a43a13be23a2 (diff) | |
download | apr-5fb06021bf1d8435b651cd2be3b8a97d6cd25d71.tar.gz |
* file_io/unix/readwrite.c (apr_file_flush): Use apr_ssize_t to store
the write() return value, remove casts.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@234014 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/unix')
-rw-r--r-- | file_io/unix/readwrite.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/file_io/unix/readwrite.c b/file_io/unix/readwrite.c index 697cfa852..258ef7265 100644 --- a/file_io/unix/readwrite.c +++ b/file_io/unix/readwrite.c @@ -289,13 +289,13 @@ APR_DECLARE(apr_status_t) apr_file_puts(const char *str, apr_file_t *thefile) APR_DECLARE(apr_status_t) apr_file_flush(apr_file_t *thefile) { if (thefile->buffered) { - apr_int64_t written = 0; - if (thefile->direction == 1 && thefile->bufpos) { + apr_ssize_t written; + do { written = write(thefile->filedes, thefile->buffer, thefile->bufpos); - } while (written == (apr_int64_t)-1 && errno == EINTR); - if (written == (apr_int64_t)-1) { + } while (written == -1 && errno == EINTR); + if (written == -1) { return errno; } thefile->filePtr += written; |