]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add guards against fcntl() not being available on Windows.
authorGeorg Brandl <georg@python.org>
Fri, 31 Mar 2006 20:27:27 +0000 (20:27 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 31 Mar 2006 20:27:27 +0000 (20:27 +0000)
 (backport from rev. 43504)

Modules/posixmodule.c

index b4cab361ff786eae4ae3b4c1cdd79442ae957717..f7032070c50bae2cc464ae29b6d265324d41da9e 100644 (file)
@@ -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();