Skip to content

Commit 81574b8

Browse files
worrbenjaminp
authored andcommitted
closes bpo-34862: Guard definition of convert_sched_param with POSIX_SPAWN_SETSCHEDULER. (GH-9658)
Fixes broken build on OpenBSD-current.
1 parent be4e5b8 commit 81574b8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Modules/clinic/posixmodule.c.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/posixmodule.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ static PyTypeObject WaitidResultType;
19421942
static int initialized;
19431943
static PyTypeObject StatResultType;
19441944
static PyTypeObject StatVFSResultType;
1945-
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER)
1945+
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
19461946
static PyTypeObject SchedParamType;
19471947
#endif
19481948
static newfunc structseq_new;
@@ -5160,8 +5160,10 @@ enum posix_spawn_file_actions_identifier {
51605160
POSIX_SPAWN_DUP2
51615161
};
51625162

5163+
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
51635164
static int
51645165
convert_sched_param(PyObject *param, struct sched_param *res);
5166+
#endif
51655167

51665168
static int
51675169
parse_posix_spawn_flags(PyObject *setpgroup, int resetids, PyObject *setsigmask,
@@ -5925,7 +5927,7 @@ os_sched_getscheduler_impl(PyObject *module, pid_t pid)
59255927
#endif /* HAVE_SCHED_SETSCHEDULER */
59265928

59275929

5928-
#if defined(HAVE_SCHED_SETSCHEDULER) || defined(HAVE_SCHED_SETPARAM)
5930+
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
59295931
/*[clinic input]
59305932
class os.sched_param "PyObject *" "&SchedParamType"
59315933
@@ -5986,7 +5988,7 @@ convert_sched_param(PyObject *param, struct sched_param *res)
59865988
res->sched_priority = Py_SAFE_DOWNCAST(priority, long, int);
59875989
return 1;
59885990
}
5989-
#endif /* defined(HAVE_SCHED_SETSCHEDULER) || defined(HAVE_SCHED_SETPARAM) */
5991+
#endif /* defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM) */
59905992

59915993

59925994
#ifdef HAVE_SCHED_SETSCHEDULER
@@ -13925,7 +13927,7 @@ INITFUNC(void)
1392513927
# endif
1392613928
#endif
1392713929

13928-
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER)
13930+
#if defined(HAVE_SCHED_SETPARAM) || defined(HAVE_SCHED_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDULER) || defined(POSIX_SPAWN_SETSCHEDPARAM)
1392913931
sched_param_desc.name = MODNAME ".sched_param";
1393013932
if (PyStructSequence_InitType2(&SchedParamType, &sched_param_desc) < 0)
1393113933
return NULL;

0 commit comments

Comments
 (0)