From 5c1498057a85a463e422d7e6464479dfe12dde20 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 31 Mar 2006 20:27:27 +0000 Subject: [PATCH] Add guards against fcntl() not being available on Windows. (backport from rev. 43504) --- Modules/posixmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index b4cab361ff78..f7032070c50b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5459,6 +5459,7 @@ posix_fdopen(PyObject *self, PyObject *args) return NULL; } Py_BEGIN_ALLOW_THREADS +#if !defined(MS_WINDOWS) && defined(HAVE_FCNTL_H) if (mode[0] == 'a') { /* try to make sure the O_APPEND flag is set */ int flags; @@ -5472,6 +5473,9 @@ posix_fdopen(PyObject *self, PyObject *args) } else { fp = fdopen(fd, mode); } +#else + fp = fdopen(fd, mode); +#endif Py_END_ALLOW_THREADS if (fp == NULL) return posix_error(); -- 2.47.3