From e2abd78a98335df958e8dbb1d513261a8cb89739 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 10 Mar 2012 09:54:08 -0800 Subject: [PATCH] Avoid warnings when O_CLOEXEC or O_EXCL are not defined. --- gzlib.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gzlib.c b/gzlib.c index 4732fcc..91c71cd 100644 --- a/gzlib.c +++ b/gzlib.c @@ -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; -- 2.7.4