mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 17:00:09 +01:00
util: fix util_cpu_detect_once() build on OpenBSD
Correct type for sysctl argument to fix the build.
../src/util/u_cpu_detect.c:631:29: error: incompatible pointer types passing 'int *' to parameter of type 'size_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types]
sysctl(mib, 2, &ncpu, &len, NULL, 0);
^~~~
Fixes: 5623c75e40 ("util: Fix setting nr_cpus on some BSD variants")
Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13448>
(cherry picked from commit afece589dc)
This commit is contained in:
parent
237197ee69
commit
e1a35767c1
2 changed files with 2 additions and 2 deletions
|
|
@ -3982,7 +3982,7 @@
|
|||
"description": "util: fix util_cpu_detect_once() build on OpenBSD",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "5623c75e40b38017873df09954b5f65dc84dcde5"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -625,7 +625,7 @@ util_cpu_detect_once(void)
|
|||
if (available_cpus == 0) {
|
||||
const int mib[] = { CTL_HW, HW_NCPUONLINE };
|
||||
int ncpu;
|
||||
int len = sizeof(ncpu);
|
||||
size_t len = sizeof(ncpu);
|
||||
|
||||
sysctl(mib, 2, &ncpu, &len, NULL, 0);
|
||||
available_cpus = ncpu;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue