]> granicus.if.org Git - python/commitdiff
Add guards against fcntl() not being available on Windows.
authorGeorg Brandl <georg@python.org>
Fri, 31 Mar 2006 20:27:22 +0000 (20:27 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 31 Mar 2006 20:27:22 +0000 (20:27 +0000)
Modules/posixmodule.c

index 631833f77a771758aea3a969800fce5212068960..a27a2af10064f71b3f945e0d9ae5af3bcec3bca2 100644 (file)
@@ -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();