From d3a91d60424308eacd10882734911e776c81250b Mon Sep 17 00:00:00 2001 From: Jack Gallagher Date: Fri, 17 Jan 2025 08:51:54 +0000 Subject: [PATCH] i#2154 Android64: Fix write syscall in nolibc_print() (#7190) Current versions of Android make the FILE struct opaque so we can't access its members to get the file descriptor for stderr. Instead we can use STDERR_FILENO from unistd.h. Issue: #1874, #2154 --- suite/tests/tools.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/suite/tests/tools.c b/suite/tests/tools.c index a57f386c671..174edfe63e8 100644 --- a/suite/tests/tools.c +++ b/suite/tests/tools.c @@ -378,16 +378,7 @@ nolibc_print(const char *str) # else SYS_write, # endif - 3, -# if defined(MACOS) || defined(ANDROID) - stderr->_file, - /* TODO i#1973: handle opaque FILE * on musl libc */ -# elif defined(MUSL) - STDERR_FILENO, -# else - stderr->_fileno, -# endif - str, nolibc_strlen(str)); + 3, STDERR_FILENO, str, nolibc_strlen(str)); } /* Safe print int syscall.