about summary refs log tree commit diff
path: root/nptl/nptl-init.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-10-18 14:29:04 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-10-18 14:29:04 +0200
commite4b3707cea0eae2cf46a82534dd9279541e7415a (patch)
treec2246b8c9cf4f12e0de4e3cd050f15a751402fb3 /nptl/nptl-init.c
parent5e20aae5ee087f394f276bd556c5c1df52d76ff9 (diff)
downloadglibc-e4b3707cea0eae2cf46a82534dd9279541e7415a.tar.gz
glibc-e4b3707cea0eae2cf46a82534dd9279541e7415a.tar.xz
glibc-e4b3707cea0eae2cf46a82534dd9279541e7415a.zip
nptl: SIGCANCEL, SIGTIMER, SIGSETXID are always defined
All nptl targets have these signal definitions nowadays.  This
changes also replaces the nptl-generic version of pthread_sigmask
with the Linux version.

Tested on x86_64-linux-gnu and i686-linux-gnu.  Built with
build-many-glibcs.py.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nptl/nptl-init.c')
-rw-r--r--nptl/nptl-init.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c
index ea91b9e138..acc0f3672b 100644
--- a/nptl/nptl-init.c
+++ b/nptl/nptl-init.c
@@ -114,9 +114,7 @@ static const struct pthread_functions pthread_functions =
     .ptr_nthreads = &__nptl_nthreads,
     .ptr___pthread_unwind = &__pthread_unwind,
     .ptr__nptl_deallocate_tsd = __nptl_deallocate_tsd,
-# ifdef SIGSETXID
     .ptr__nptl_setxid = __nptl_setxid,
-# endif
     .ptr_set_robust = __nptl_set_robust
   };
 # define ptr_pthread_functions &pthread_functions
@@ -139,7 +137,6 @@ __nptl_set_robust (struct pthread *self)
 }
 
 
-#ifdef SIGCANCEL
 /* For asynchronous cancellation we use a signal.  This is the handler.  */
 static void
 sigcancel_handler (int sig, siginfo_t *si, void *ctx)
@@ -185,10 +182,8 @@ sigcancel_handler (int sig, siginfo_t *si, void *ctx)
       oldval = curval;
     }
 }
-#endif
 
 
-#ifdef SIGSETXID
 struct xid_command *__xidcmd attribute_hidden;
 
 /* We use the SIGSETXID signal in the setuid, setgid, etc. implementations to
@@ -234,7 +229,6 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx)
   if (atomic_decrement_val (&__xidcmd->cntr) == 0)
     futex_wake ((unsigned int *) &__xidcmd->cntr, 1, FUTEX_PRIVATE);
 }
-#endif
 
 
 /* When using __thread for this, we do it in libc so as not
@@ -285,41 +279,31 @@ __pthread_initialize_minimal_internal (void)
      had to set __nptl_initial_report_events.  Propagate its setting.  */
   THREAD_SETMEM (pd, report_events, __nptl_initial_report_events);
 
-#if defined SIGCANCEL || defined SIGSETXID
   struct sigaction sa;
   __sigemptyset (&sa.sa_mask);
 
-# ifdef SIGCANCEL
   /* Install the cancellation signal handler.  If for some reason we
      cannot install the handler we do not abort.  Maybe we should, but
      it is only asynchronous cancellation which is affected.  */
   sa.sa_sigaction = sigcancel_handler;
   sa.sa_flags = SA_SIGINFO;
   (void) __libc_sigaction (SIGCANCEL, &sa, NULL);
-# endif
 
-# ifdef SIGSETXID
   /* Install the handle to change the threads' uid/gid.  */
   sa.sa_sigaction = sighandler_setxid;
   sa.sa_flags = SA_SIGINFO | SA_RESTART;
   (void) __libc_sigaction (SIGSETXID, &sa, NULL);
-# endif
 
   /* The parent process might have left the signals blocked.  Just in
      case, unblock it.  We reuse the signal mask in the sigaction
      structure.  It is already cleared.  */
-# ifdef SIGCANCEL
   __sigaddset (&sa.sa_mask, SIGCANCEL);
-# endif
-# ifdef SIGSETXID
   __sigaddset (&sa.sa_mask, SIGSETXID);
-# endif
   {
     INTERNAL_SYSCALL_DECL (err);
     (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &sa.sa_mask,
 			     NULL, _NSIG / 8);
   }
-#endif
 
   /* Get the size of the static and alignment requirements for the TLS
      block.  */