From: Mark Adler Date: Sun, 4 Mar 2012 19:26:25 +0000 (-0800) Subject: Make sure that O_EXCL is used portably. X-Git-Tag: v1.2.7~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e04ce09154a078910a7878f2e36905f458f309f;p=thirdparty%2Fzlib-ng.git Make sure that O_EXCL is used portably. --- diff --git a/gzlib.c b/gzlib.c index fec7fbf7f..4732fcc02 100644 --- a/gzlib.c +++ b/gzlib.c @@ -196,10 +196,13 @@ local gzFile gz_open(path, fd, mode) #endif (state->mode == GZ_READ ? O_RDONLY : - (O_WRONLY | O_CREAT | (exclusive ? O_EXCL : 0) | ( - state->mode == GZ_WRITE ? - O_TRUNC : - O_APPEND))), + (O_WRONLY | O_CREAT | +#ifdef O_EXCL + (exclusive ? O_EXCL : 0) | +#endif + (state->mode == GZ_WRITE ? + O_TRUNC : + O_APPEND))), 0666); if (state->fd == -1) { free(state->path);