diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-03-10 09:54:08 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-03-10 09:54:08 -0800 |
commit | e2abd78a98335df958e8dbb1d513261a8cb89739 (patch) | |
tree | a3c23b432027778c2dc9b33033971b0b08f9eb8b /gzlib.c | |
parent | 9f4d9052dc08284ee5f248224fd2e7c334c579f8 (diff) | |
download | zlib-e2abd78a98335df958e8dbb1d513261a8cb89739.tar.gz |
Avoid warnings when O_CLOEXEC or O_EXCL are not defined.
Diffstat (limited to 'gzlib.c')
-rw-r--r-- | gzlib.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -94,7 +94,12 @@ local gzFile gz_open(path, fd, mode) const char *mode; { gz_statep state; - int cloexec = 0, exclusive = 0; +#ifdef O_CLOEXEC + int cloexec = 0; +#endif +#ifdef O_EXCL + int exclusive = 0; +#endif /* check input */ if (path == NULL) @@ -134,12 +139,16 @@ local gzFile gz_open(path, fd, mode) return NULL; case 'b': /* ignore -- will request binary anyway */ break; +#ifdef O_CLOEXEC case 'e': cloexec = 1; break; +#endif +#ifdef O_EXCL case 'x': exclusive = 1; break; +#endif case 'f': state->strategy = Z_FILTERED; break; |