From 644b1e7aac8f048ade4709f248c4d66b85800efc Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Fri, 31 Mar 2006 20:27:22 +0000 Subject: [PATCH] Add guards against fcntl() not being available on Windows. --- Modules/posixmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 631833f77a7..a27a2af1006 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5769,6 +5769,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; @@ -5782,6 +5783,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();