[hurd,commited] hurd: Sign-extend the sigcode passed to msg_sig_post
Samuel Thibault
samuel.thibault@ens-lyon.org
Sun Mar 1 16:04:23 GMT 2026
The negative sigcodes are reserved for SI_* values, we need to keep them
negative when extending to exc_subcode's long type.
This fixes the comparison in HURD_PREEMPT_SIGNAL_P for the signal preemptor
for setitimer, thus fixing considering it.it_interval.
Reported-by: David Yang <mmyangfl@gmail.com>
---
hurd/hurdsig.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 91e664d0f1..b202d1fdfc 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -1392,7 +1392,7 @@ _S_msg_sig_post (mach_port_t me,
if (err = signal_allowed (signo, refport))
return err;
- d.code = d.exc_subcode = sigcode;
+ d.code = d.exc_subcode = (int) sigcode;
d.exc = 0;
/* Post the signal to a global receiver thread (or mark it pending in
--
2.51.0
More information about the Libc-alpha
mailing list