From 9946ecfac968fd071f5e9b52f3fdedf55dd7893c Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Thu, 20 Oct 2022 16:40:47 +0000 Subject: testfile: try to determine how apr_file_datasync() fails for streams on macos. * test/testfile.c(test_datasync_on_stream): Let ABTS_INT_EQUAL show the actual errno. test/testfile.c: apr_file_datasync() fails with ENOTSUP for streams on macos. * test/testfile.c(test_datasync_on_stream): Handle ENOTSUP on macos. Merge r1902175, r1902180 from trunk. Merges r1902228 from ^/apr/apr/branches/1.8.x. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1904747 13f79535-47bb-0310-9956-ffa450edef68 --- test/testfile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/testfile.c b/test/testfile.c index 25bfef5bf..b1e9c554b 100644 --- a/test/testfile.c +++ b/test/testfile.c @@ -1251,7 +1251,13 @@ static void test_datasync_on_stream(abts_case *tc, void *data) rv = apr_file_write_full(f, "abcdef\b\b\b\b\b\b\b", 12, &bytes_written); APR_ASSERT_SUCCESS(tc, "write to stdout", rv); rv = apr_file_datasync(f); - ABTS_TRUE(tc, rv == APR_SUCCESS || APR_STATUS_IS_EINVAL(rv)); + if (rv != APR_SUCCESS) { +#if defined(__APPLE__) + ABTS_INT_EQUAL(tc, ENOTSUP, rv); +#else + ABTS_INT_EQUAL(tc, APR_EINVAL, rv); +#endif + } } abts_suite *testfile(abts_suite *suite) -- cgit v1.2.1