From 0bb2fabcb3bcac064a3d89917c0736353cdac2f4 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 3 Jul 2017 15:00:26 -0300 Subject: Consolidate non cancellable openat call This patch consolidates all the non cancellable openat{64} calls to use the __openat{64}_nocancel identifier. For non cancellable targets it will be just a macro to call the default respective symbol while on Linux will be a internal one. Checked on x86_64-linux-gnu, x86_64-linux-gnu-x32, and i686-linux-gnu. * sysdeps/generic/not-cancel.h (openat_not_cancel): Remove macro. (openat_not_cancel_3): Likewise. (openat64_not_cancel_3): Likewise). (openat_not_cancel_3): Likewise). * sysdeps/unix/sysv/linux/not-cancel.h (openat_not_cancel): Remove macro. (openat_not_cancel_3): Likewise. (openat64_not_cancel): Likewise. (openat64_not_cancel_3): Likewise. * sysdeps/unix/sysv/linux/openat.c (__openat_nocancel): New function. * sysdeps/unix/sysv/linux/openat64.c (__openat64_nocancel): Likewise. * io/ftw.c (open_dir_stream): Replace openat{64}_not_cancel{_3} with __open{64}_nocancel. * sysdeps/mach/hurd/opendir.c (__opendirat): Likewise. * sysdeps/posix/getcwd.c (__getcwd): Likewise. * sysdeps/posix/opendir.c (__opendirat): Likewise. --- sysdeps/generic/not-cancel.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'sysdeps/generic') diff --git a/sysdeps/generic/not-cancel.h b/sysdeps/generic/not-cancel.h index e91cb6cced..df9aea640b 100644 --- a/sysdeps/generic/not-cancel.h +++ b/sysdeps/generic/not-cancel.h @@ -22,14 +22,10 @@ __open (__VA_ARGS__) #define __open64_nocancel(...) \ __open64 (__VA_ARGS__) -#define openat_not_cancel(fd, name, flags, mode) \ - __openat (fd, name, flags, mode) -#define openat_not_cancel_3(fd, name, flags) \ - __openat (fd, name, flags, 0) -#define openat64_not_cancel(fd, name, flags, mode) \ - __openat64 (fd, name, flags, mode) -#define openat64_not_cancel_3(fd, name, flags) \ - __openat64 (fd, name, flags, 0) +#define __openat_nocancel(...) \ + __openat (__VA_ARGS__) +#define __openat64_nocancel(...) \ + __openat64 (__VA_ARGS__) #define close_not_cancel(fd) \ __close (fd) #define close_not_cancel_no_status(fd) \ -- cgit v1.2.3