From ae4aef0ba367143a8eb14c5f0a3133dc43ea4f7c Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Thu, 8 Dec 2022 21:29:28 +0900 Subject: [PATCH] universal7885: parts-aidl: Check r/w perms --- universal7885-common/apps/aidl-support/parts/default/Swap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universal7885-common/apps/aidl-support/parts/default/Swap.cpp b/universal7885-common/apps/aidl-support/parts/default/Swap.cpp index b6d7434..d60378f 100644 --- a/universal7885-common/apps/aidl-support/parts/default/Swap.cpp +++ b/universal7885-common/apps/aidl-support/parts/default/Swap.cpp @@ -112,7 +112,7 @@ namespace aidl::vendor::eureka::hardware::parts { static std::mutex thread_lock; -static inline bool swapfile_exist(void) { return access(SWAP_PATH, F_OK) == 0; } +static inline bool swapfile_exist(void) { return access(SWAP_PATH, R_OK | W_OK) == 0; } static void makeFile(int32_t mSwapSize) { const std::lock_guard lock(thread_lock);