diff options
Diffstat (limited to 'sysdeps/pthread/sem_open.c')
-rw-r--r-- | sysdeps/pthread/sem_open.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sysdeps/pthread/sem_open.c b/sysdeps/pthread/sem_open.c index dab7341..e5eacb5 100644 --- a/sysdeps/pthread/sem_open.c +++ b/sysdeps/pthread/sem_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2024 Free Software Foundation, Inc. +/* Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,6 +26,7 @@ #include <futex-internal.h> #include <libc-lock.h> + #if !PTHREAD_IN_LIBC /* The private names are not exported from libc. */ # define __link link @@ -57,11 +58,7 @@ __sem_open (const char *name, int oflag, ...) } /* Disable asynchronous cancellation. */ -#ifdef __libc_ptf_call - int state; - __libc_ptf_call (__pthread_setcancelstate, - (PTHREAD_CANCEL_DISABLE, &state), 0); -#endif + int state = __pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &state); /* If the semaphore object has to exist simply open it. */ if ((oflag & O_CREAT) == 0 || (oflag & O_EXCL) == 0) @@ -214,9 +211,7 @@ __sem_open (const char *name, int oflag, ...) } out: -#ifdef __libc_ptf_call - __libc_ptf_call (__pthread_setcancelstate, (state, NULL), 0); -#endif + __pthread_setcancelstate (state, NULL); return result; } |