From 5e6eb8dd01f473fb0356353ef8b5a5e271613561 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 30 May 2022 01:21:38 -0700 Subject: [PATCH] Avoid non-blocking I/O --- native/jni/su/connect.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native/jni/su/connect.cpp b/native/jni/su/connect.cpp index 3521037cc..ea1d19cab 100644 --- a/native/jni/su/connect.cpp +++ b/native/jni/su/connect.cpp @@ -217,7 +217,8 @@ int app_request(const su_context &ctx) { exec_cmd("request", extras, ctx.info, false); // Wait for data input for at most 70 seconds - int fd = xopen(fifo, O_RDONLY | O_CLOEXEC | O_NONBLOCK); + // Open with O_RDWR to prevent FIFO open block + int fd = xopen(fifo, O_RDWR | O_CLOEXEC); struct pollfd pfd = { .fd = fd, .events = POLLIN