From fd3df63fb6649720098597ced59eaa3969bbe067 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 28 Jun 2020 15:51:40 +0000 Subject: hurd: make close a cancellation point and add _nocancel variant. * sysdeps/mach/hurd/Makefile [io] (sysdep_routines): Add close_nocancel. * sysdeps/mach/hurd/Versions (libc.GLIBC_PRIVATE, ld.GLIBC_PRIVATE): Add __close_nocancel. * sysdeps/mach/hurd/i386/localplt.data (__close_nocancel): Allow PLT. * sysdeps/mach/hurd/close.c: Include (__libc_close): Surround _hurd_fd_close with enabling async cancel. * sysdeps/mach/hurd/close_nocancel.c: New file. * sysdeps/mach/hurd/not-cancel.h (__close_nocancel): Replace macro with declaration with hidden proto. --- sysdeps/mach/hurd/close.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysdeps/mach/hurd/close.c') diff --git a/sysdeps/mach/hurd/close.c b/sysdeps/mach/hurd/close.c index 4b1e203084..b461087447 100644 --- a/sysdeps/mach/hurd/close.c +++ b/sysdeps/mach/hurd/close.c @@ -19,14 +19,18 @@ #include #include #include +#include /* Close the file descriptor FD. */ int __close (int fd) { error_t err; + int cancel_oldtype; + cancel_oldtype = LIBC_CANCEL_ASYNC(); err = HURD_FD_USE (fd, _hurd_fd_close (descriptor)); + LIBC_CANCEL_RESET (cancel_oldtype); return err ? __hurd_fail (err) : 0; } -- cgit 1.4.1