From: Georg Brandl Date: Fri, 31 Mar 2006 20:27:27 +0000 (+0000) Subject: Add guards against fcntl() not being available on Windows. X-Git-Tag: v2.4.4c1~310 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c1498057a85a463e422d7e6464479dfe12dde20;p=thirdparty%2FPython%2Fcpython.git Add guards against fcntl() not being available on Windows. (backport from rev. 43504) --- 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();