From fb997c8a8c1cde191986336d3ea83e911b32700b Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 7 Aug 2023 10:18:49 +0800 Subject: [PATCH] Repair hang in android_fdopen * src/androidvfs.c (android_fdopen): Do not neglect to update next when iterating through open_parcel_fds. --- src/androidvfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/androidvfs.c b/src/androidvfs.c index d6daff481b0..5afa752163d 100644 --- a/src/androidvfs.c +++ b/src/androidvfs.c @@ -5606,7 +5606,7 @@ android_saf_file_open (struct android_vnode *vnode, int flags, method = service_class.open_document; trunc = (flags & O_TRUNC); - write = ((flags & O_RDWR) == O_RDWR || (flags & O_WRONLY)); + write = (((flags & O_RDWR) == O_RDWR) || (flags & O_WRONLY)); inside_saf_critical_section = true; descriptor = (*android_java_env)->CallNonvirtualObjectMethod (android_java_env, @@ -6917,11 +6917,12 @@ android_fdopen (int fd, const char *mode) if (fd != new_fd) emacs_abort (); - goto open_file; + break; } + else + next = &(*next)->next; } - open_file: return fdopen (fd, mode); } -- 2.39.5