link to upstream merged PR for pledge, drop test bits

This commit is contained in:
kn 2023-10-11 21:21:12 +00:00
parent df4353cf31
commit 8c8d324198
2 changed files with 1 additions and 19 deletions

View File

@ -1,4 +1,5 @@
Use pledge(2), xxhsum(1) only ever reads files or stdin.
merged https://github.com/Cyan4973/xxHash/pull/880
Index: cli/xsum_os_specific.c
--- cli/xsum_os_specific.c.orig

View File

@ -1,19 +0,0 @@
Use pledge(2), the sanity test does even not read files.
Index: tests/sanity_test.c
--- tests/sanity_test.c.orig
+++ tests/sanity_test.c
@@ -639,6 +639,13 @@ int main(int argc, const char* argv[])
(void) argc;
(void) argv;
+#ifdef __OpenBSD__
+ if (pledge("stdio", NULL) == -1) {
+ XSUM_log("pledge: %s\n", strerror(errno));
+ return EXIT_FAILURE;
+ }
+#endif
+
{
/* XXH32 */
size_t const n = sizeof(XSUM_XXH32_testdata) / sizeof(XSUM_XXH32_testdata[0]);