aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;