Skip to content

Commit e18126a

Browse files
Aleksei VoitylovAlexander Scherbatiy
authored andcommitted
8252248: __SIGRTMAX is not declared in musl libc
Reviewed-by: stuefe Backport-of: 5490b03
1 parent 49f9105 commit e18126a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/java.base/linux/native/libnet/linux_close.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef struct {
6060
/*
6161
* Signal to unblock thread
6262
*/
63-
static int sigWakeup = (__SIGRTMAX - 2);
63+
#define WAKEUP_SIGNAL (SIGRTMAX - 2)
6464

6565
/*
6666
* fdTable holds one entry per file descriptor, up to a certain
@@ -152,10 +152,10 @@ static void __attribute((constructor)) init() {
152152
sa.sa_handler = sig_wakeup;
153153
sa.sa_flags = 0;
154154
sigemptyset(&sa.sa_mask);
155-
sigaction(sigWakeup, &sa, NULL);
155+
sigaction(WAKEUP_SIGNAL, &sa, NULL);
156156

157157
sigemptyset(&sigset);
158-
sigaddset(&sigset, sigWakeup);
158+
sigaddset(&sigset, WAKEUP_SIGNAL);
159159
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
160160
}
161161

@@ -305,7 +305,7 @@ static int closefd(int fd1, int fd2) {
305305
threadEntry_t *curr = fdEntry->threads;
306306
while (curr != NULL) {
307307
curr->intr = 1;
308-
pthread_kill( curr->thr, sigWakeup );
308+
pthread_kill( curr->thr, WAKEUP_SIGNAL);
309309
curr = curr->next;
310310
}
311311
}

src/java.base/unix/native/libnio/ch/NativeThread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#ifdef __linux__
3737
#include <pthread.h>
3838
/* Also defined in net/linux_close.c */
39-
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
39+
#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
4040
#elif _AIX
4141
#include <pthread.h>
4242
/* Also defined in net/aix_close.c */

0 commit comments

Comments
 (0)