From: Paul Floyd Date: Tue, 23 Dec 2025 09:55:25 +0000 (+0100) Subject: Darwin regtest: update none apple-main-arg for macOS 10.14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fa05936488fcaaa079dffbf359d32167a540fe8;p=thirdparty%2Fvalgrind.git Darwin regtest: update none apple-main-arg for macOS 10.14 Looks like the apple pointer to the executable name started having a prefix starting with macOS 10.14. --- diff --git a/none/tests/darwin/apple-main-arg.c b/none/tests/darwin/apple-main-arg.c index e49d5ed9a..d7f275aee 100644 --- a/none/tests/darwin/apple-main-arg.c +++ b/none/tests/darwin/apple-main-arg.c @@ -24,19 +24,21 @@ int main(int argc, char *argv[], char *envp[], char *apple[]) // Make sure realpath(argv[0]) == realpath(apple[0]). (realpath resolves // symlinks.) - // PJF this changed with macOS 11, apple path now has a prefix -#if (DARWIN_VERS >= DARWIN_11_00) + // PJF this changed with macOS 10.14, apple path now has a prefix +#if (DARWIN_VERS >= DARWIN_10_14) const char prefix[] = "executable_path="; const size_t prefix_len = strlen(prefix); assert(strncmp(apple[0], prefix, prefix_len) == 0); realpath(apple[0]+prefix_len, pappl); - exit(0); #else realpath(apple[0], pappl); #endif realpath(argv[0], pargv); assert(0 == strcmp(pargv, pappl)); + free(pargv); + free(pappl); + return 0; }