emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master fb997c8a8c1: Repair hang in android_fdopen


From: Po Lu
Subject: master fb997c8a8c1: Repair hang in android_fdopen
Date: Sun, 6 Aug 2023 22:22:13 -0400 (EDT)

branch: master
commit fb997c8a8c1cde191986336d3ea83e911b32700b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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);
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]