summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-06-24 11:49:32 +0000
committerYann Ylavic <ylavic@apache.org>2022-06-24 11:49:32 +0000
commit3ed48a685ce1ece3e32862685ff847e486d31ab2 (patch)
tree31a0c027ef46e08f2c25a665b7a3d51d2eb195f3
parentf58a4dd210a0991e3299f0a61478b97d8db847b3 (diff)
downloadapr-3ed48a685ce1ece3e32862685ff847e486d31ab2.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. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1902228 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 cf6bf2e2d..b817d1a05 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
+ }
}
static void test_append(abts_case *tc, void *data)