提交 e2abd78a 编写于 作者: M Mark Adler

Avoid warnings when O_CLOEXEC or O_EXCL are not defined.

上级 9f4d9052
...@@ -94,7 +94,12 @@ local gzFile gz_open(path, fd, mode) ...@@ -94,7 +94,12 @@ local gzFile gz_open(path, fd, mode)
const char *mode; const char *mode;
{ {
gz_statep state; gz_statep state;
int cloexec = 0, exclusive = 0; #ifdef O_CLOEXEC
int cloexec = 0;
#endif
#ifdef O_EXCL
int exclusive = 0;
#endif
/* check input */ /* check input */
if (path == NULL) if (path == NULL)
...@@ -134,12 +139,16 @@ local gzFile gz_open(path, fd, mode) ...@@ -134,12 +139,16 @@ local gzFile gz_open(path, fd, mode)
return NULL; return NULL;
case 'b': /* ignore -- will request binary anyway */ case 'b': /* ignore -- will request binary anyway */
break; break;
#ifdef O_CLOEXEC
case 'e': case 'e':
cloexec = 1; cloexec = 1;
break; break;
#endif
#ifdef O_EXCL
case 'x': case 'x':
exclusive = 1; exclusive = 1;
break; break;
#endif
case 'f': case 'f':
state->strategy = Z_FILTERED; state->strategy = Z_FILTERED;
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册