aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-03-10 09:54:08 -0800
committerMark Adler <madler@alumni.caltech.edu>2012-03-10 09:54:08 -0800
commite2abd78a98335df958e8dbb1d513261a8cb89739 (patch)
treea3c23b432027778c2dc9b33033971b0b08f9eb8b
parent9f4d9052dc08284ee5f248224fd2e7c334c579f8 (diff)
downloadzlib-e2abd78a98335df958e8dbb1d513261a8cb89739.tar.gz
zlib-e2abd78a98335df958e8dbb1d513261a8cb89739.tar.bz2
zlib-e2abd78a98335df958e8dbb1d513261a8cb89739.zip
Avoid warnings when O_CLOEXEC or O_EXCL are not defined.
-rw-r--r--gzlib.c11
1 files changed, 10 insertions, 1 deletions
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)
94 const char *mode; 94 const char *mode;
95{ 95{
96 gz_statep state; 96 gz_statep state;
97 int cloexec = 0, exclusive = 0; 97#ifdef O_CLOEXEC
98 int cloexec = 0;
99#endif
100#ifdef O_EXCL
101 int exclusive = 0;
102#endif
98 103
99 /* check input */ 104 /* check input */
100 if (path == NULL) 105 if (path == NULL)
@@ -134,12 +139,16 @@ local gzFile gz_open(path, fd, mode)
134 return NULL; 139 return NULL;
135 case 'b': /* ignore -- will request binary anyway */ 140 case 'b': /* ignore -- will request binary anyway */
136 break; 141 break;
142#ifdef O_CLOEXEC
137 case 'e': 143 case 'e':
138 cloexec = 1; 144 cloexec = 1;
139 break; 145 break;
146#endif
147#ifdef O_EXCL
140 case 'x': 148 case 'x':
141 exclusive = 1; 149 exclusive = 1;
142 break; 150 break;
151#endif
143 case 'f': 152 case 'f':
144 state->strategy = Z_FILTERED; 153 state->strategy = Z_FILTERED;
145 break; 154 break;