Update Android port

* 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.
This commit is contained in:
Po Lu 2023-10-03 08:55:57 +08:00
parent ad2bb3e9f3
commit 1ad2d2f77c
2 changed files with 60 additions and 24 deletions

View file

@ -1921,6 +1921,21 @@ android_afs_open (struct android_vnode *vnode, int flags,
/* Size of the file. */
info->statb.st_size = AAsset_getLength (asset);
/* If the installation date can be ascertained, return that as
the file's modification time. */
if (timespec_valid_p (emacs_installation_time))
{
#ifdef STAT_TIMESPEC
STAT_TIMESPEC (&info->statb, st_mtim) = emacs_installation_time;
#else /* !STAT_TIMESPEC */
/* Headers supplied by the NDK r10b contain a `struct stat'
without POSIX fields for nano-second timestamps. */
info->statb.st_mtime = emacs_installation_time.tv_sec;
info->statb.st_mtime_nsec = emacs_installation_time.tv_nsec;
#endif /* STAT_TIMESPEC */
}
/* Chain info onto afs_file_descriptors. */
afs_file_descriptors = info;
@ -7365,6 +7380,21 @@ android_asset_fstat (struct android_fd_or_asset asset,
statb->st_uid = 0;
statb->st_gid = 0;
/* If the installation date can be ascertained, return that as the
file's modification time. */
if (timespec_valid_p (emacs_installation_time))
{
#ifdef STAT_TIMESPEC
STAT_TIMESPEC (statb, st_mtim) = emacs_installation_time;
#else /* !STAT_TIMESPEC */
/* Headers supplied by the NDK r10b contain a `struct stat'
without POSIX fields for nano-second timestamps. */
statb->st_mtime = emacs_installation_time.tv_sec;
statb->st_mtime_nsec = emacs_installation_time.tv_nsec;
#endif /* STAT_TIMESPEC */
}
/* Size of the file. */
statb->st_size = AAsset_getLength (asset.asset);
return 0;

View file

@ -20297,20 +20297,23 @@ handle_one_xevent (struct x_display_info *dpyinfo,
/* See if keysym should make Emacs quit. */
if (keysym == dpyinfo->quit_keysym
&& (xkey.time - dpyinfo->quit_keysym_time
<= 350))
if (dpyinfo->quit_keysym)
{
Vquit_flag = Qt;
goto done_keysym;
}
if (keysym == dpyinfo->quit_keysym
&& (xkey.time - dpyinfo->quit_keysym_time
<= 350))
{
Vquit_flag = Qt;
goto done_keysym;
}
if (keysym == dpyinfo->quit_keysym)
{
/* Otherwise, set the last time that keysym was
pressed. */
dpyinfo->quit_keysym_time = xkey.time;
goto done_keysym;
if (keysym == dpyinfo->quit_keysym)
{
/* Otherwise, set the last time that keysym was
pressed. */
dpyinfo->quit_keysym_time = xkey.time;
goto done_keysym;
}
}
/* If not using XIM/XIC, and a compose sequence is in progress,
@ -24227,20 +24230,23 @@ handle_one_xevent (struct x_display_info *dpyinfo,
/* See if keysym should make Emacs quit. */
if (keysym == dpyinfo->quit_keysym
&& (xev->time - dpyinfo->quit_keysym_time
<= 350))
if (dpyinfo->quit_keysym)
{
Vquit_flag = Qt;
goto xi_done_keysym;
}
if (keysym == dpyinfo->quit_keysym
&& (xev->time - dpyinfo->quit_keysym_time
<= 350))
{
Vquit_flag = Qt;
goto xi_done_keysym;
}
if (keysym == dpyinfo->quit_keysym)
{
/* Otherwise, set the last time that keysym was
pressed. */
dpyinfo->quit_keysym_time = xev->time;
goto xi_done_keysym;
if (keysym == dpyinfo->quit_keysym)
{
/* Otherwise, set the last time that keysym
was pressed. */
dpyinfo->quit_keysym_time = xev->time;
goto xi_done_keysym;
}
}
/* First deal with keysyms which have defined