public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] hurd: Make nanosleep a cancellation point
@ 2020-02-10  1:04 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2020-02-10  1:04 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7e7182256a104da518018a0b4edfe51689487f42

commit 7e7182256a104da518018a0b4edfe51689487f42
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sun Feb 9 22:27:56 2020 +0000

    hurd: Make nanosleep a cancellation point

Diff:
---
 sysdeps/mach/clock_nanosleep.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sysdeps/mach/clock_nanosleep.c b/sysdeps/mach/clock_nanosleep.c
index ae9335c..23ebc15 100644
--- a/sysdeps/mach/clock_nanosleep.c
+++ b/sysdeps/mach/clock_nanosleep.c
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <posix-timer.h>
 #include <shlib-compat.h>
+#include <sysdep-cancel.h>
 
 static int
 nanosleep_call (const struct timespec *req, struct timespec *rem)
@@ -39,9 +40,13 @@ nanosleep_call (const struct timespec *req, struct timespec *rem)
   if (rem != NULL)
     __clock_gettime (CLOCK_REALTIME, &before);
 
+  int cancel_oldtype = LIBC_CANCEL_ASYNC();
   err = __mach_msg (NULL, MACH_RCV_MSG|MACH_RCV_TIMEOUT|MACH_RCV_INTERRUPT,
                     0, 0, recv, ms, MACH_PORT_NULL);
+  LIBC_CANCEL_RESET (cancel_oldtype);
+
   __mach_port_destroy (mach_task_self (), recv);
+
   if (err == EMACH_RCV_INTERRUPTED)
     {
       if (rem != NULL)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-10  1:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10  1:04 [glibc] hurd: Make nanosleep a cancellation point Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).