]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Sign-extend the sigcode passed to msg_sig_post
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 1 Mar 2026 16:01:25 +0000 (17:01 +0100)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 1 Mar 2026 16:04:09 +0000 (17:04 +0100)
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

index 91e664d0f1b3659b9e95de6692b856ce5db0fddd..b202d1fdfcc025b0f08f6e2c9c684b78b3fc61e0 100644 (file)
@@ -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