selftests/futex: getopt() requires int as return value.
Mark reported that futex_priv_hash fails on ARM64. It turns out that the command line parsing does not terminate properly and ends in the default case assuming an invalid option was passed. Use an int as the return type for getopt(). Closes: https://lore.kernel.org/all/31869a69-063f-44a3-a079-ba71b2506cce@sirena.org.uk/ Fixes: 3163369407baf ("selftests/futex: Add futex_numa_mpol") Fixes: cda95faef7bcf ("selftests/futex: Add futex_priv_hash") Reported-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20250528085521.1938355-2-bigeasy@linutronix.de
This commit is contained in:
parent
ec7714e494
commit
1a9dcf69c7
@ -144,7 +144,7 @@ int main(int argc, char *argv[])
|
||||
struct futex32_numa *futex_numa;
|
||||
int mem_size, i;
|
||||
void *futex_ptr;
|
||||
char c;
|
||||
int c;
|
||||
|
||||
while ((c = getopt(argc, argv, "chv:")) != -1) {
|
||||
switch (c) {
|
||||
|
||||
@ -130,7 +130,7 @@ int main(int argc, char *argv[])
|
||||
pthread_mutexattr_t mutex_attr_pi;
|
||||
int use_global_hash = 0;
|
||||
int ret;
|
||||
char c;
|
||||
int c;
|
||||
|
||||
while ((c = getopt(argc, argv, "cghv:")) != -1) {
|
||||
switch (c) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user