From e79d06d595e05553fde3c5b8d229ae4ad12977dd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 31 Oct 2018 17:12:21 +0100 Subject: [PATCH] fs/io/FileOutputStream: don't use O_TMPFILE on Android Fixes writing to Context.getCacheDir(). --- src/fs/io/FileOutputStream.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fs/io/FileOutputStream.hxx b/src/fs/io/FileOutputStream.hxx index 08ffef2d6..aec4001fe 100644 --- a/src/fs/io/FileOutputStream.hxx +++ b/src/fs/io/FileOutputStream.hxx @@ -46,7 +46,12 @@ #include #endif -#ifdef __linux__ +#if defined(__linux__) && !defined(ANDROID) +/* we don't use O_TMPFILE on Android because Android's braindead + SELinux policy disallows hardlinks + (https://android.googlesource.com/platform/external/sepolicy/+/85ce2c7), + even hardlinks from /proc/self/fd/*, which however is required to + use O_TMPFILE */ #define HAVE_O_TMPFILE #endif