summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-06-24 11:49:32 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-06-24 11:49:32 +0000
commitf48f5fc4918050ed950b1201dcf2e0c7bf3b17c8 (patch)
tree31a0c027ef46e08f2c25a665b7a3d51d2eb195f3
parent693f0bfdf558718213eb6a180ba3cfae4e4d1c72 (diff)
downloadlibapr-f48f5fc4918050ed950b1201dcf2e0c7bf3b17c8.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)