Merge "sigqueue/pthread_sigqueue: cleanup." into main
diff --git a/libc/bionic/pthread_sigqueue.cpp b/libc/bionic/pthread_sigqueue.cpp
index 93c349e..7c10b25 100644
--- a/libc/bionic/pthread_sigqueue.cpp
+++ b/libc/bionic/pthread_sigqueue.cpp
@@ -40,14 +40,16 @@
int pthread_sigqueue(pthread_t t, int sig, const union sigval value) {
ErrnoRestorer errno_restorer;
+ pid_t pid = getpid();
+
pid_t tid = __pthread_internal_gettid(t, "pthread_sigqueue");
if (tid == -1) return ESRCH;
- siginfo_t siginfo;
- siginfo.si_code = SI_QUEUE;
- siginfo.si_pid = getpid();
+ siginfo_t siginfo = { .si_code = SI_QUEUE };
+ siginfo.si_signo = sig;
+ siginfo.si_pid = pid;
siginfo.si_uid = getuid();
siginfo.si_value = value;
- return syscall(__NR_rt_tgsigqueueinfo, getpid(), tid, sig, &siginfo) ? errno : 0;
+ return syscall(__NR_rt_tgsigqueueinfo, pid, tid, sig, &siginfo) ? errno : 0;
}
diff --git a/libc/bionic/signal.cpp b/libc/bionic/signal.cpp
index 2cf9940..5979ed7 100644
--- a/libc/bionic/signal.cpp
+++ b/libc/bionic/signal.cpp
@@ -219,10 +219,8 @@
}
int sigqueue(pid_t pid, int sig, const sigval value) {
- siginfo_t info;
- memset(&info, 0, sizeof(siginfo_t));
+ siginfo_t info = { .si_code = SI_QUEUE };
info.si_signo = sig;
- info.si_code = SI_QUEUE;
info.si_pid = getpid();
info.si_uid = getuid();
info.si_value = value;