summaryrefslogtreecommitdiff
path: root/src/utilfuns/zlib/gzwrite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilfuns/zlib/gzwrite.c')
-rw-r--r--src/utilfuns/zlib/gzwrite.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/utilfuns/zlib/gzwrite.c b/src/utilfuns/zlib/gzwrite.c
index aa767fb..5b4c677 100644
--- a/src/utilfuns/zlib/gzwrite.c
+++ b/src/utilfuns/zlib/gzwrite.c
@@ -4,7 +4,12 @@
*/
#include "gzguts.h"
-
+#if !defined(__GNUC__) && !defined(_WIN32_WCE)
+#include <io.h>
+#include <direct.h>
+#else
+#include <unistd.h>
+#endif
/* Local functions */
local int gz_init OF((gz_statep));
local int gz_comp OF((gz_statep, int));
@@ -81,7 +86,7 @@ local int gz_comp(state, flush)
/* write directly if requested */
if (state->direct) {
- got = write(state->fd, strm->next_in, strm->avail_in);
+ got = (int)write(state->fd, strm->next_in, strm->avail_in);
if (got < 0 || (unsigned)got != strm->avail_in) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
@@ -98,7 +103,7 @@ local int gz_comp(state, flush)
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
(flush != Z_FINISH || ret == Z_STREAM_END))) {
have = (unsigned)(strm->next_out - state->x.next);
- if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
+ if (have && ((got = (int)write(state->fd, state->x.next, have)) < 0 ||
(unsigned)got != have)) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;