diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp index e0338e6f619b7..43233decf1b34 100644 --- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp +++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/close.pass.cpp @@ -10,11 +10,6 @@ // basic_filebuf* close(); -// This test closes an fd that belongs to a std::filebuf, and Bionic's fdsan -// detects this and aborts the process, starting in Android R (API 30). -// See D137129. -// XFAIL: LIBCXX-ANDROID-FIXME && !android-device-api={{2[1-9]}} - #include #include #if defined(__unix__) @@ -37,7 +32,10 @@ int main(int, char**) assert(f.close() == nullptr); assert(!f.is_open()); } -#if defined(__unix__) + // Starting with Android API 30+, Bionic's fdsan aborts a process that calls + // close() on a file descriptor tagged as belonging to something else (such + // as a FILE*). +#if defined(__unix__) && !defined(__BIONIC__) { std::filebuf f; assert(!f.is_open());