diff options
| author | Po Lu | 2024-01-19 20:51:24 +0800 |
|---|---|---|
| committer | Po Lu | 2024-01-19 20:51:24 +0800 |
| commit | bd5bfc29137b6e452e1900a1fc3cf09e77959133 (patch) | |
| tree | 71b00e5e79d35670a587643e6cb173a7a48f5ad2 /src | |
| parent | dd2caf1a7634ea6fd8aebbdc45ea4caf22d786cd (diff) | |
| download | emacs-bd5bfc29137b6e452e1900a1fc3cf09e77959133.tar.gz emacs-bd5bfc29137b6e452e1900a1fc3cf09e77959133.zip | |
Fix another cause of superfluous inotify signals on Android
* src/android.c (android_select): If the event queue isn't
empty upon the initial check, clear all fdsets.
Diffstat (limited to 'src')
| -rw-r--r-- | src/android.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/android.c b/src/android.c index 757f256c188..fb7703d84ab 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -744,6 +744,19 @@ android_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 744 | 744 | ||
| 745 | if (event_queue.num_events) | 745 | if (event_queue.num_events) |
| 746 | { | 746 | { |
| 747 | /* Zero READFDS, WRITEFDS and EXCEPTFDS, lest the caller | ||
| 748 | mistakenly interpret this return value as indicating that an | ||
| 749 | inotify file descriptor is readable, and try to poll an | ||
| 750 | unready one. */ | ||
| 751 | |||
| 752 | if (readfds) | ||
| 753 | FD_ZERO (readfds); | ||
| 754 | |||
| 755 | if (writefds) | ||
| 756 | FD_ZERO (writefds); | ||
| 757 | |||
| 758 | if (exceptfds) | ||
| 759 | FD_ZERO (exceptfds); | ||
| 747 | pthread_mutex_unlock (&event_queue.mutex); | 760 | pthread_mutex_unlock (&event_queue.mutex); |
| 748 | return 1; | 761 | return 1; |
| 749 | } | 762 | } |