aboutsummaryrefslogtreecommitdiffstats
path: root/src/androidvfs.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ; Add 2026 to copyright years.Sean Whitton2026-01-011-1/+1
|
* Replace call[1-8] with callnStefan Kangas2025-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the introduction of the 'calln' macro, the 'call1', 'call2', ..., 'call8' macros are just aliases for the former. This is slightly misleading and potentially unhelpful. The number of arguments N can also easily go out-of-synch with the used alias callN. There is no reason not to replace these aliases with using 'calln' directly. To reduce the risk for mistakes, the tool Coccinelle was used to make these changes. See <https://coccinelle.gitlabpages.inria.fr/website/>. * src/alloc.c, src/androidvfs.c, src/androidfns.c, src/buffer.c: * src/callint.c, src/callproc.c, src/casefiddle.c, src/charset.c: * src/chartab.c, src/cmds.c, src/coding.c, src/composite.c: * src/data.c, src/dbusbind.c, src/dired.c, src/doc.c: * src/emacs.c, src/eval.c, src/fileio.c, src/filelock.c: * src/fns.c, src/frame.c, src/gtkutil.c, src/haikufns.c: * src/haikumenu.c, src/image.c, src/insdel.c, src/intervals.c: * src/keyboard.c, src/keymap.c, src/lisp.h, src/lread.c: * src/minibuf.c, src/nsfns.m, src/nsselect.m, src/pgtkfns.c: * src/pgtkselect.c, src/print.c, src/process.c, src/sort.c: * src/syntax.c, src/textconv.c, src/textprop.c, src/undo.c: * src/w32fns.c, src/window.c, src/xfaces.c, src/xfns.c: * src/xmenu.c, src/xselect.c, src/xterm.c: Replace all uses of 'call1', 'call2', ..., 'call8' with 'calln'.
* Update copyright year to 2025Paul Eggert2025-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright".
* Prefer static_assert to verifyStefan Kangas2024-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although static_assert is C11-specific, and Emacs remains on C99, it has been backported to older compilers by Gnulib. Gnulib has already changed to prefer static_assert, and we can do the same. * lib-src/asset-directory-tool.c (main_2): * src/alloc.c (BLOCK_ALIGN, aligned_alloc, lisp_align_malloc) (vectorlike_nbytes, allocate_pseudovector): * src/android.c (android_globalize_reference, android_set_dashes): * src/android.h: * src/androidfont.c (androidfont_draw, androidfont_text_extents): * src/androidvfs.c: * src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT, bidi_find_bracket_pairs): * src/buffer.c (init_buffer_once): * src/casefiddle.c (do_casify_multibyte_string): * src/dispnew.c (scrolling_window, scrolling): * src/editfns.c (styled_format): * src/emacs-module.c (module_extract_big_integer): * src/fileio.c (Fdo_auto_save): * src/fns.c (next_almost_prime, hash_string): * src/fringe.c (init_fringe): * src/keyboard.h (kbd_buffer_store_event_hold): * src/keymap.c: * src/lisp.h (memclear, reduce_emacs_uint_to_hash_hash, modiff_incr): * src/lread.c (skip_lazy_string): * src/pdumper.c (dump_bignum, Fdump_emacs_portable) (dump_do_dump_relocation, pdumper_load): * src/process.c (make_process, Fmake_process, connect_network_socket): * src/regex-emacs.c: * src/sort.c (tim_sort): * src/sysdep.c (init_random, SSIZE_MAX): * src/thread.c: * src/timefns.c (trillion_factor): * src/unexelf.c: * src/xterm.c (x_send_scroll_bar_event): Prefer static_assert to Gnulib verify. Remove import of verify.h, except when used for other reasons.
* Port better to NFS unlinkPaul Eggert2024-08-151-1/+1
| | | | | | | | | | | | | I found this problem while looking into Bug#72641. * lib-src/etags.c (do_move_file): * lib-src/update-game-score.c (unlock_file): * src/androidvfs.c (android_hack_asset_fd_fallback): * src/filelock.c (current_lock_owner): Treat unlink as successful if it fails because the file wasn’t there. This can happen with some NFS implementations, due to its retrying over the network to get at-least-once semantics. Although most of Emacs’s calls to unlink were already doing this, a few instances were not.
* Prevent accesses to /content files without a GUI connectionPo Lu2024-08-071-2/+3
| | | | | * src/androidvfs.c (android_content_name): Hide all subdirectories when `android_init_gui' is not set.
* ; Fix typosStefan Kangas2024-07-181-1/+1
|
* * src/androidvfs.c (android_saf_check_nonnull): Fix typo.Po Lu2024-07-071-1/+1
|
* Correct JNI string error checking and miscellaneous correctionsPo Lu2024-07-071-1/+32
| | | | | | | | | | | | * src/android-emacs.c (main): Do not attempt to load the bootstrap class path, which is redundant on all Android releases. * src/android.c (initEmacs, android_browse_url): Do not assume exceptions will be raised if GetStringUTFChars fails. Decode Android JNI strings as Qandroid_jni. * src/androidvfs.c (android_saf_check_nonnull): New function. (android_saf_new_mkdir): Likewise.
* Don't follow symlinks in returning directory attributes of /Po Lu2024-06-191-19/+22
| | | | | | | | | | * src/androidvfs.c (struct android_vops) <stat>: New argument for flags. (android_unix_stat): Implement in terms of fstatat, not stat, and provide flags to the same. (android_afs_stat, android_content_stat, android_authority_stat) (android_saf_root_stat, android_saf_tree_stat) (android_saf_new_stat, android_fstatat): Adjust to match.
* Correct resolution of non-virtual directory names on AndroidPo Lu2024-06-181-30/+50
| | | | | | | | | * src/androidvfs.c (android_vfs_canonicalize_name): Correct return value in cases of underflowing the directory stack. (android_unix_name): Reset vnode operations vector of copied vnodes to their standard value, and exclude virtual directories from subdirectories of the root directory's parent directory. (android_root_name): Adjust to match.
* Restore functionality on Android 2.2Po Lu2024-06-121-15/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/Makefile.in (install_temp): Do not compress directory-tree and generate such files in a special format that stores file sizes. * lib-src/asset-directory-tool.c (struct directory_tree): New field st_size. (need_file_size): New variable. (main_1, main_2, main): Write file sizes before sibling offsets if `--api-8' is specified. * src/android-asset.h (struct android_asset_manager): New field open. (struct android_asset): New field name. (AAssetManager_fromJava): Load AssetManager#open. (AAssetManager_open): If a directory tree has already been loaded, search for a matching asset and load its size thence, to avoid the requirement of an AssetFileDescriptor. (AAsset_close): Don't assume asset->fd exists. Release asset->name. (AAsset_getLength): Likewise. (android_asset_create_stream): If asset->name exists, call AssetManager#open, in order to open compressed files. * src/androidvfs.c (OLD_ANDROID_ASSETS): Define to 1 on API 8. (android_extract_long, android_scan_directory_tree): Mark arguments as const. Adjust offsets when OLD_ANDROID_ASSETS. (android_is_directory, android_init_assets, android_afs_readdir): Likewise. * src/lread.c (lread_fstat): Define to sys_fstat, not fstat.
* Properly deinitialize directory cursors on closedirPo Lu2024-05-121-0/+4
| | | | | | | * src/androidvfs.c (android_saf_tree_closedir): Call cursor.close, for deleting the local reference to enable its garbage collection is not sufficient to release all related resources.
* Remove redundant encoding of strings in androidvfs.cPo Lu2024-05-101-12/+8
| | | | | | | | | * java/org/gnu/emacs/EmacsService.java (getDocumentTrees): Accept PROVIDER as a String. * src/android.c (android_init_emacs_service): * src/androidvfs.c (android_saf_root_opendir): Adjust to match.
* Fix earlier change to content URI resolution on AndroidPo Lu2024-05-101-109/+112
| | | | | | | | | * java/org/gnu/emacs/EmacsService.java (openContentUri): Return -1 if fd be NULL. * src/androidvfs.c (android_authority_open): Detect SecurityException and suchlike. (android_vfs_init): Initialize exception classes on Android 4.4.
* Don't report erroneous /content directory on Android 4.3 and earlierPo Lu2024-05-091-1/+1
| | | | | * src/androidvfs.c (android_content_opendir): Skip two, not one, elements on Android <= 4.4.
* Fix compatibility issues with Android clipboardsPo Lu2024-05-011-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsClipboard.java (getClipboardData): Return an AssetFileDescriptor. * java/org/gnu/emacs/EmacsContextMenu.java (onMenuItemClick): Typo corrections in commentary. * java/org/gnu/emacs/EmacsOpenActivity.java (onCreate): Raise minimum version on which to read file descriptors from ParcelFileDescriptor objects to Honeycomb. * java/org/gnu/emacs/EmacsSdk11Clipboard.java (getClipboardData): Return the asset file descriptor. * java/org/gnu/emacs/EmacsSdk8Clipboard.java (getClipboardData): Adjust return type to match. * src/android.h (struct android_parcel_file_descriptor_class): Move from androidselect.c. * src/androidselect.c (fd_class): Export function. (android_init_emacs_clipboard): Adjust signature of getClipboardData. (android_init_asset_file_descriptor, close_asset_fd) (extract_fd_offsets): New functions. (Fandroid_get_clipboard_data): Extract file descriptor and offset from the AssetFileDescriptor here, rather than in getClipboardData. (init_androidselect): Call android_init_asset_file_descriptor. * src/androidvfs.c (android_init_fd_class): Export and enable calling this function more than once.
* Better verify arguments to android-relinquish-directory-accessPo Lu2024-04-211-5/+12
| | | | | | | | * src/androidvfs.c (Fandroid_relinquish_directory_access): Provide for NULL values from android_name_file and remote files. * src/xdisp.c (decode_mode_spec): Don't intern file-remote-p. (syms_of_xdisp) <Qfile_remote_p>: New defsym.
* Eliminate minor wart in EmacsService.javaPo Lu2024-04-201-24/+8
| | | | | | | | | | * java/org/gnu/emacs/EmacsService.java (openContentUri): Replace arg BYTES with URI and change its type to String. * src/android.c (android_init_emacs_service): * src/androidvfs.c (android_authority_name) (android_authority_open): Adjust commentary and code to match.
* Enable relinquishing access to Android content directoriesPo Lu2024-04-051-2/+52
| | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/android.texi (Android Document Providers): Document new command. * java/org/gnu/emacs/EmacsService.java (relinquishUriRights): New function. * src/Makefile.in (SOME_MACHINE_OBJECTS): Add androidvfs.c. * src/android.c (android_init_emacs_service): Link to new function. * src/android.h (struct android_emacs_service) <relinquish_uri_rights>: New field. * src/androidfns.c: * src/androidvfs.c (android_saf_tree_name) (android_saf_tree_opendir): Minor adjustments to commentary. (Fandroid_relinquish_directory_access): New function. (syms_of_androidvfs): Define new subr.
* Fix listing of Android root directory when it is accessiblePo Lu2024-04-011-15/+10
| | | | | | | * src/androidvfs.c (android_root_closedir, android_root_dirfd) (android_root_opendir): Allocate an ersatz file descriptor even if directory is non-NULL, so that at-funcs will properly return file status for virtual files in the root directory.
* List special directories when reading root directory on AndroidPo Lu2024-03-311-3/+124
| | | | | | | | | | | | | | | * src/androidvfs.c (root_vfs_ops): Substitute android_root_opendir for android_root_opendir. (struct android_root_vdir): New structure. (root_fd, root_fd_references): New variables. (android_root_readdir, android_root_closedir, android_root_dirfd) (android_root_opendir): New functions. (android_fstatat_1): Test provided fd against root_fd, and if they match, prefix FILENAME with the name of the root directory. * lisp/ls-lisp.el (ls-lisp-insert-directory): If d-f-a-a signals an error while retrieving attributes, compile the alist of directory contents by hand.
* Minor adjustments to last changePo Lu2024-03-231-11/+6
| | | | | | * src/androidvfs.c (android_vfs_convert_name): Simplify. (android_saf_tree_readdir, android_root_name): Remove redundant statements.
* Correctly handle non-BMP characters in Android content file namesPo Lu2024-03-231-16/+121
| | | | | | | | | | | | | | | | | | | | | * lisp/term/android-win.el (android-encode-jni) (android-decode-jni, android-jni): New coding system, for Android file names and runtime data. * src/androidterm.h (syms_of_androidvfs): New function. * src/androidvfs.c (struct android_special_vnode): New field special_coding_system. (android_saf_tree_readdir): Decode the file name using the android-jni coding system. (special_vnodes): <contents>: Specify a file name coding system. (android_vfs_convert_name): New function. (android_root_name): If a special coding system be specified for a special vnode, convert components to it before invoking its name function. (syms_of_androidvfs): New symbol Qandroid_jni. * src/emacs.c (android_emacs_init): Call syms_of_androidvfs.
* Respect display names of Android content URIsPo Lu2024-03-191-14/+136
| | | | | | | | | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsNative.java (displayNameHash): New function. * java/org/gnu/emacs/EmacsService.java (buildContentName): New argument RESOLVER. Generate names holding URI's display name if available. All callers changed. * lisp/international/mule-cmds.el (set-default-coding-systems): Fix file name coding system as utf-8-unix on Android as on Mac OS. * src/androidvfs.c (enum android_vnode_type): New enum ANDROID_VNODE_CONTENT_AUTHORITY_NAMED. (android_content_name): Register root directories for this new type. (displayNameHash): New function. (android_get_content_name): New argument WITH_CHECKSUM. If present, treat the final two components as a pair of checksum and display name, and verify and exclude the two. (android_authority_name): Provide new argument as appropriate. (android_authority_initial_name): New function.
* Implement notification callbacks on AndroidPo Lu2024-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/os.texi (Desktop Notifications): Document that :on-cancel, :on-action and :actions are now supported on Android. * java/org/gnu/emacs/EmacsActivity.java (onNewIntent): New function. * java/org/gnu/emacs/EmacsDesktopNotification.java (NOTIFICATION_ACTION, NOTIFICATION_TAG, NOTIFICATION_DISMISSED): New constants. <actions, titles>: New fields. (insertActions): New function. (display1, display): Insert actions on Jelly Bean and up, and arrange to be notified when the notification is dismissed. (CancellationReceiver): New class. * java/org/gnu/emacs/EmacsNative.java (sendNotificationDeleted) (sendNotificationAction): New functions. * src/android.c (sendDndDrag, sendDndUri, sendDndText): Correct return types. (sendNotificationDeleted, sendNotificationAction) (android_exception_check_5, android_exception_check_6): New functions. * src/android.h: * src/androidgui.h (struct android_notification_event): New structure. (union android_event): New member for notification events. * src/androidselect.c (android_init_emacs_desktop_notification): Update JNI signatures. (android_notifications_notify_1, Fandroid_notifications_notify): New arguments ACTIONS, ACTION_CB and CANCEL_CB. Convert and record them as appropriate. (android_notification_deleted, android_notification_action): New functions. (syms_of_androidselect): Prepare a hash table of outstanding notifications. <QCactions, QCon_action, QCon_cancel> New defsyms. * src/androidterm.c (handle_one_android_event) <ANDROID_NOTIFICATION_DELETED> <ANDROID_NOTIFICATION_ACTION>: Dispatch event contents to androidselect.c for processing. * src/androidterm.h: * src/androidvfs.c (java_string_class): Export. * src/keyboard.c (kbd_buffer_get_event) <NOTIFICATION_EVENT>: Call callback specified by the event. * src/termhooks.h (enum event_kind) [HAVE_ANDROID]: New enum NOTIFICATION_EVENT.
* ; Insert missing JNI prologuesPo Lu2024-02-221-0/+8
| | | | | | | | * src/android.c (shouldForwardMultimediaButtons) (shouldForwardCtrlSpace, notifyPixelsChanged, setupSystemThread): * src/androidvfs.c (safSyncAndReadInput, safSync, safPostRequest) (ftruncate): Insert absent JNI prologues.
* * src/androidvfs.c (android_scan_directory_tree): Get rid of xstrdup.Po Lu2024-02-161-13/+11
|
* Fix use after free in androidvfs.cStefan Kangas2024-01-101-2/+2
| | | | | * src/androidvfs.c (android_afs_opendir, android_saf_tree_opendir): Fix use after free.
* ; Add 2024 to copyright yearsPo Lu2024-01-021-1/+1
|
* ; Fix typosStefan Kangas2023-12-101-4/+4
|
* Minor adjustments to Android drag and drop and content URIsPo Lu2023-10-281-17/+27
| | | | | | | | | | | | | * java/org/gnu/emacs/EmacsWindow.java (EmacsWindow) <dndXPosition, dndYPosition>: New fields initialized to -1. (onDragEvent): Remember the position of the previous event to avoid sending duplicates. * src/androidvfs.c (EMACS_PATH_MAX): New define. (android_saf_tree_rename, android_saf_tree_opendir) (android_name_file, android_fstatat, android_faccessat) (android_fchmodat, android_readlinkat): Use EMACS_PATH_MAX where SAF file names might be encountered.
* Substitute eassert for assert throughout Android codePo Lu2023-10-271-2/+2
| | | | | | | | | | | | | | | | | | * src/android.c (android_init_emacs_service) (android_init_emacs_pixmap, android_init_graphics_point) (android_init_emacs_drawable, android_init_emacs_window) (android_init_emacs_cursor, android_destroy_handle) (android_create_window, android_init_android_rect_class) (android_init_emacs_gc_class, android_begin_query): * src/androidselect.c (android_init_emacs_clipboard) (android_init_emacs_desktop_notification): * src/androidterm.c (getExtractedText) (android_get_surrounding_text_internal): * src/androidvfs.c (android_vfs_init): Replace assert with eassert.
* Correctly receive files through Android DNDPo Lu2023-10-151-4/+16
| | | | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsService.java (getUsefulContentResolver) (getContentResolverContext): New functions which return a content resolver from an EmacsActivity, if at all possible. (openContentUri, checkContentUri): Probe or open URIs through such content resolvers. Probe URIs by opening them if merely testing permissions fails, for DND URIs do not make checkCallingUriPermission return true. * java/org/gnu/emacs/EmacsWindow.java (onDragEvent): Address potential crash. * src/androidvfs.c (android_check_content_access): Circumvent JNI dynamic method dispatch. (android_authority_name): Guarantee NAME is never a directory.
* Correct local reference leaksPo Lu2023-10-041-2/+6
| | | | | | | | | | | | | | | | | | | | * src/android.c (android_build_string): Accept a list of local references to destroy upon an allocation failure, facilitating the proper deallocation of local references in such situations. (android_browse_url): Revise for new calling convention. * src/android.h (android_build_string): Update declaration correspondingly. * src/androidmenu.c (android_menu_show, android_dialog_show): Revise for new calling convention. * src/androidselect.c (android_notifications_notify_1): Supply each successive local reference to android_build_string as notification text is being encoded. * src/androidvfs.c (android_saf_exception_check): Introduce absent va_end.
* Update Android portPo Lu2023-10-031-0/+30
| | | | | | | | | | * src/androidvfs.c (android_afs_open, android_asset_fstat): Return proper mtime within file descriptors incorporating asset data and within android_asset_fstat. * src/xterm.c (handle_one_xevent) <KeyPress, XI_KeyPress>: Verify presence of a quit keysym prior to registering it.
* Update Android portPo Lu2023-09-241-24/+27
| | | | | | | | | * java/org/gnu/emacs/EmacsSdk11Clipboard.java (getClipboardData): Correct typo in comment. * src/androidvfs.c (android_authority_open) (android_saf_delete_document): Circumvent JNI dynamic method dispatch.
* Avoid virtual function dispatch overheadPo Lu2023-09-051-5/+7
| | | | | * src/androidvfs.c (android_saf_move_document): Circumvent JNI dynamic function dispatch on call to final method.
* Include installation date within asset filesPo Lu2023-08-311-1/+20
| | | | | | | | | | | | * src/android.c (setEmacsParams): Set `emacs_installation_time' to the mtime of the class path file, which happens to be the time of Emacs's installation. (emacs_installation_time): New variable. * src/android.h (emacs_installation_time): Export new variable. * src/androidvfs.c (android_afs_stat): If emacs_installation_time is a valid timespec, set st_mtime to it.
* Make some file I/O operations more robust on AndroidPo Lu2023-08-191-2/+139
| | | | | | | | | | | | | | | | | | | | * src/android.h (android_readlinkat): New prototype. * src/androidvfs.c (struct android_vops): New function pointer `readlink'. (unix_vfs_ops, android_unix_readlink, afs_vfs_ops) (android_afs_readlink, content_vfs_ops, android_content_mkdir) (android_content_chmod, authority_vfs_ops) (android_authority_readlink, saf_root_vfs_ops) (android_saf_root_readlink, saf_tree_vfs_ops) (android_saf_tree_readlink, saf_file_vfs_ops, saf_new_vfs_ops) (android_saf_new_readlink, root_vfs_ops): Implement new `readlink' vops for each vnode type. (android_readlinkat): New function. * src/fileio.c (Fcopy_file): Be more flexible about SELinux errors under Android. (emacs_readlinkat): Use `android_readlink' when built as libemacs.so.
* ; Remove set but unused variablePo Lu2023-08-191-3/+0
| | | | | * src/androidvfs.c (android_check_content_access): Delete `length'.
* Improve efficiency of checking for access to authority documentsPo Lu2023-08-141-23/+34
| | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsService.java (checkContentUri): Take a string instead of a byte array. Then, use checkCallingUriPermission, in lieu of opening the file. * src/android.c (android_check_content_access): Delete unused function. (android_init_emacs_service): Adjust for changes to checkContentUri's signature. * src/androidvfs.c (android_get_content_name): Return the file name in a new buffer. (android_check_content_access): Adjust correspondingly. (android_authority_name): Verify NAME is a valid JNI string.
* Avoid caching file status when they are about to changePo Lu2023-08-081-8/+18
| | | | | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread) (cacheFileStatus): New argument NO_CACHE. (cacheDirectoryFromCursor, statDocument1): * java/org/gnu/emacs/EmacsService.java (EmacsService) (statDocument): Plumb that argument through each of these wrapper functions. * src/android.c (android_init_emacs_service): Adjust JNI function signatures to agree with statDocument1. * src/androidvfs.c (android_saf_stat): Plumb that argument through here. (android_saf_tree_stat, android_saf_file_open): And don't cache file status if a write is imminent.
* Minor improvements to write-region heuristicPo Lu2023-08-081-1/+14
| | | | | | | | * src/androidvfs.c (android_saf_stat): Set STATB->st_dev. (android_fstat): Likewise. (NATIVE_NAME): Seek to start of file after truncation. * src/fileio.c (write_region): Use stat instead of open+fstat to obtain updated mtime.
* * src/androidvfs.c (android_saf_file_open): Improve commentary.Po Lu2023-08-081-6/+8
|
* Utilize more frequently supported file access modesPo Lu2023-08-081-5/+41
| | | | | | | | | | | | | * java/org/gnu/emacs/EmacsSafThread.java (openDocument1): Use plain r or w where possible, as the fileio stuff is now better prepared for FIFOs. (openDocument): New argument READ. * java/org/gnu/emacs/EmacsService.java (openDocument): New argument READ. * src/android.c (android_init_emacs_service): Adjust correspondingly. * src/androidvfs.c (android_saf_file_open): Don't support O_APPEND. Pass read as well as trunc and write.
* Port to the Android NDK r10bPo Lu2023-08-071-4/+18
| | | | | | | * src/androidvfs.c (android_saf_stat, android_saf_file_open) (android_fstat): Eschew accessing POSIX timespec fields in struct stat, employing accessors supplied in Gnulib stat-time.h in their place.
* Repair hang in android_fdopenPo Lu2023-08-071-3/+4
| | | | | * src/androidvfs.c (android_fdopen): Do not neglect to update next when iterating through open_parcel_fds.
* Update Android portPo Lu2023-08-061-1/+7
| | | | | | | | | | | | * java/org/gnu/emacs/EmacsNative.java: Declare ftruncate. * java/org/gnu/emacs/EmacsSafThread.java (openDocument1): If initially opening with rwt, verify the file descriptor is really writable; if not, resort to rw and truncating the file descriptor by hand instead. * src/androidvfs.c (NATIVE_NAME (ftruncate)): New function. Truncate file descriptor and return whether that was successful.
* Update Android portPo Lu2023-08-061-4/+4
| | | | | * src/androidvfs.c (android_saf_tree_chmod): Repair file access permissions allowed within FLAGS.