diff options
| author | Michael Albinus | 2025-02-28 18:04:35 +0100 |
|---|---|---|
| committer | Michael Albinus | 2025-02-28 18:04:35 +0100 |
| commit | 73c646b7771bc81e622933443b5b336d40f8d8c2 (patch) | |
| tree | 00f2b6dbc0231137f7fd71973fd9ede2d6ec7f21 /src | |
| parent | 0af5c5749988180c6a2f7c50b7e1c8163b4c5bf1 (diff) | |
| parent | c8cec840d7972d5cca0c255a19fd521703c7628c (diff) | |
| download | emacs-73c646b7771bc81e622933443b5b336d40f8d8c2.tar.gz emacs-73c646b7771bc81e622933443b5b336d40f8d8c2.zip | |
Merge branch 'emacs-30' of git.sv.gnu.org:/srv/git/emacs into emacs-30
Diffstat (limited to 'src')
| -rw-r--r-- | src/android.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/android.c b/src/android.c index c20730460be..bcd48e300ff 100644 --- a/src/android.c +++ b/src/android.c | |||
| @@ -304,7 +304,7 @@ static struct android_event_queue event_queue; | |||
| 304 | /* Semaphores used to signal select completion and start. */ | 304 | /* Semaphores used to signal select completion and start. */ |
| 305 | static sem_t android_pselect_sem, android_pselect_start_sem; | 305 | static sem_t android_pselect_sem, android_pselect_start_sem; |
| 306 | 306 | ||
| 307 | #if __ANDROID_API__ < 16 | 307 | #if __ANDROID_API__ < 21 |
| 308 | 308 | ||
| 309 | /* Select self-pipe. */ | 309 | /* Select self-pipe. */ |
| 310 | static int select_pipe[2]; | 310 | static int select_pipe[2]; |
| @@ -363,7 +363,7 @@ android_run_select_thread (void *data) | |||
| 363 | JNI_STACK_ALIGNMENT_PROLOGUE; | 363 | JNI_STACK_ALIGNMENT_PROLOGUE; |
| 364 | 364 | ||
| 365 | int rc; | 365 | int rc; |
| 366 | #if __ANDROID_API__ < 16 | 366 | #if __ANDROID_API__ < 21 |
| 367 | int nfds; | 367 | int nfds; |
| 368 | fd_set readfds; | 368 | fd_set readfds; |
| 369 | char byte; | 369 | char byte; |
| @@ -375,7 +375,7 @@ android_run_select_thread (void *data) | |||
| 375 | /* Set the name of this thread's LWP for debugging purposes. */ | 375 | /* Set the name of this thread's LWP for debugging purposes. */ |
| 376 | android_set_task_name ("`android_select'"); | 376 | android_set_task_name ("`android_select'"); |
| 377 | 377 | ||
| 378 | #if __ANDROID_API__ < 16 | 378 | #if __ANDROID_API__ < 21 |
| 379 | /* A completely different implementation is used when building for | 379 | /* A completely different implementation is used when building for |
| 380 | Android versions earlier than 16, because pselect with a signal | 380 | Android versions earlier than 16, because pselect with a signal |
| 381 | mask does not work there. Instead of blocking SIGUSR1 and | 381 | mask does not work there. Instead of blocking SIGUSR1 and |
| @@ -451,12 +451,12 @@ android_run_select_thread (void *data) | |||
| 451 | sem_post (&android_pselect_sem); | 451 | sem_post (&android_pselect_sem); |
| 452 | } | 452 | } |
| 453 | #else | 453 | #else |
| 454 | sigfillset (&signals); | ||
| 454 | if (pthread_sigmask (SIG_BLOCK, &signals, NULL)) | 455 | if (pthread_sigmask (SIG_BLOCK, &signals, NULL)) |
| 455 | __android_log_print (ANDROID_LOG_FATAL, __func__, | 456 | __android_log_print (ANDROID_LOG_FATAL, __func__, |
| 456 | "pthread_sigmask: %s", | 457 | "pthread_sigmask: %s", |
| 457 | strerror (errno)); | 458 | strerror (errno)); |
| 458 | 459 | ||
| 459 | sigfillset (&signals); | ||
| 460 | sigdelset (&signals, SIGUSR1); | 460 | sigdelset (&signals, SIGUSR1); |
| 461 | sigemptyset (&waitset); | 461 | sigemptyset (&waitset); |
| 462 | sigaddset (&waitset, SIGUSR1); | 462 | sigaddset (&waitset, SIGUSR1); |
| @@ -514,7 +514,7 @@ android_run_select_thread (void *data) | |||
| 514 | return NULL; | 514 | return NULL; |
| 515 | } | 515 | } |
| 516 | 516 | ||
| 517 | #if __ANDROID_API__ >= 16 | 517 | #if __ANDROID_API__ >= 21 |
| 518 | 518 | ||
| 519 | static void | 519 | static void |
| 520 | android_handle_sigusr1 (int sig, siginfo_t *siginfo, void *arg) | 520 | android_handle_sigusr1 (int sig, siginfo_t *siginfo, void *arg) |
| @@ -569,7 +569,7 @@ android_init_events (void) | |||
| 569 | 569 | ||
| 570 | main_thread_id = pthread_self (); | 570 | main_thread_id = pthread_self (); |
| 571 | 571 | ||
| 572 | #if __ANDROID_API__ >= 16 | 572 | #if __ANDROID_API__ >= 21 |
| 573 | 573 | ||
| 574 | /* Before starting the select thread, make sure the disposition for | 574 | /* Before starting the select thread, make sure the disposition for |
| 575 | SIGUSR1 is correct. */ | 575 | SIGUSR1 is correct. */ |
| @@ -762,7 +762,7 @@ android_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 762 | fd_set *exceptfds, struct timespec *timeout) | 762 | fd_set *exceptfds, struct timespec *timeout) |
| 763 | { | 763 | { |
| 764 | int nfds_return; | 764 | int nfds_return; |
| 765 | #if __ANDROID_API__ < 16 | 765 | #if __ANDROID_API__ < 21 |
| 766 | static char byte; | 766 | static char byte; |
| 767 | #endif | 767 | #endif |
| 768 | 768 | ||
| @@ -818,7 +818,7 @@ android_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 818 | /* Start waiting for the event queue condition to be set. */ | 818 | /* Start waiting for the event queue condition to be set. */ |
| 819 | pthread_cond_wait (&event_queue.read_var, &event_queue.mutex); | 819 | pthread_cond_wait (&event_queue.read_var, &event_queue.mutex); |
| 820 | 820 | ||
| 821 | #if __ANDROID_API__ >= 16 | 821 | #if __ANDROID_API__ >= 21 |
| 822 | /* Interrupt the select thread now, in case it's still in | 822 | /* Interrupt the select thread now, in case it's still in |
| 823 | pselect. */ | 823 | pselect. */ |
| 824 | pthread_kill (event_queue.select_thread, SIGUSR1); | 824 | pthread_kill (event_queue.select_thread, SIGUSR1); |