From d0595544647564bd7f0e657322d726a8eed30f5c Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 5 Mar 2024 20:49:16 -0500 Subject: [PATCH] Some workarounds for Haiku. uv_fs_scandir can't tell if a dirent is a file. setrlimit doesn't do anything productive for us. --- src/ssb.import.c | 6 +++++- src/tests.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ssb.import.c b/src/ssb.import.c index cc97e6e0..19dd3be6 100644 --- a/src/ssb.import.c +++ b/src/ssb.import.c @@ -128,7 +128,11 @@ static void _tf_ssb_import_recursive_add_files(tf_ssb_t* ssb, uv_loop_t* loop, J uv_dirent_t ent; while (uv_fs_scandir_next(&req, &ent) == 0) { - if (ent.type == UV_DIRENT_FILE) + if (ent.type == UV_DIRENT_FILE +#if defined(__HAIKU__) + || ent.type == UV_DIRENT_UNKNOWN +#endif + ) { size_t len = strlen(path) + strlen(ent.name) + 2; char* full_path = tf_malloc(len); diff --git a/src/tests.c b/src/tests.c index 961542de..47bc14e6 100644 --- a/src/tests.c +++ b/src/tests.c @@ -58,6 +58,7 @@ static void _test_nop(const tf_test_options_t* options) assert(WEXITSTATUS(result) == 0); } +#if !defined(__HAIKU__) static void _test_sandbox(const tf_test_options_t* options) { _write_file("out/test.js", @@ -91,6 +92,7 @@ static void _test_sandbox(const tf_test_options_t* options) unlink("out/test.js"); unlink("out/child.js"); } +#endif static void _test_child(const tf_test_options_t* options) { @@ -881,7 +883,9 @@ void tf_tests(const tf_test_options_t* options) _tf_test_run(options, "ssb_id", tf_ssb_test_id_conversion, false); _tf_test_run(options, "ssb_following", tf_ssb_test_following, false); _tf_test_run(options, "nop", _test_nop, false); +#if !defined(__HAIKU__) _tf_test_run(options, "sandbox", _test_sandbox, false); +#endif _tf_test_run(options, "child", _test_child, false); _tf_test_run(options, "promise", _test_promise, false); _tf_test_run(options, "promise_remote_throw", _test_promise_remote_throw, false);