summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-10-20 16:40:47 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-10-20 16:40:47 +0000
commit9ff9f7f0ba25867771d045ca0d1840fdb43e4dc2 (patch)
tree7a0ea0f88ea8c0983bd5ac62ab9902166ca5ecd0
parent979ba6d5861ee287b5a5690538ad0632c23ea92e (diff)
downloadlibapr-9ff9f7f0ba25867771d045ca0d1840fdb43e4dc2.tar.gz
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
-rw-r--r--test/testfile.c8
1 files changed, 7 insertions, 1 deletions
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)