GH-93899: fix checks for eventfd flags (GH-95170)

This commit is contained in:
Kumar Aditya 2022-07-27 18:35:29 +05:30 committed by GitHub
parent 2b37395612
commit 4dd099baff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 10 deletions

View file

@ -13107,7 +13107,7 @@ os_memfd_create_impl(PyObject *module, PyObject *name, unsigned int flags)
}
#endif
#ifdef HAVE_EVENTFD
#if defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC)
/*[clinic input]
os.eventfd
@ -13178,7 +13178,7 @@ os_eventfd_write_impl(PyObject *module, int fd, unsigned long long value)
}
Py_RETURN_NONE;
}
#endif /* HAVE_EVENTFD */
#endif /* HAVE_EVENTFD && EFD_CLOEXEC */
/* Terminal size querying */
@ -15465,11 +15465,15 @@ all_ins(PyObject *m)
#endif
#endif /* HAVE_MEMFD_CREATE */
#ifdef HAVE_EVENTFD
#if defined(HAVE_EVENTFD) && defined(EFD_CLOEXEC)
if (PyModule_AddIntMacro(m, EFD_CLOEXEC)) return -1;
#ifdef EFD_NONBLOCK
if (PyModule_AddIntMacro(m, EFD_NONBLOCK)) return -1;
#endif
#ifdef EFD_SEMAPHORE
if (PyModule_AddIntMacro(m, EFD_SEMAPHORE)) return -1;
#endif
#endif /* HAVE_EVENTFD && EFD_CLOEXEC */
#if defined(__APPLE__)
if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;