]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Darwin regtest: update none apple-main-arg for macOS 10.14
authorPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 23 Dec 2025 09:55:25 +0000 (10:55 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Tue, 23 Dec 2025 09:55:25 +0000 (10:55 +0100)
Looks like the apple pointer to the executable name started having a prefix
starting with macOS 10.14.

none/tests/darwin/apple-main-arg.c

index e49d5ed9a9a868057a2cad6175baf2e60e808826..d7f275aee57d09b5bb640d5aeba927ee0ded29fc 100644 (file)
@@ -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;
 }