aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-12-05 14:56:06 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-12-27 11:18:23 -0300
commit58bd592536cbf491ff6f89b73b5c95beb4859e42 (patch)
tree31c1da8a5bd076f72124e2ac56f66a245f420264
parent11519fd0c908df2dad50f36a48eb4d0d12ea83a8 (diff)
downloadglibc-58bd592536cbf491ff6f89b73b5c95beb4859e42.zip
glibc-58bd592536cbf491ff6f89b73b5c95beb4859e42.tar.gz
glibc-58bd592536cbf491ff6f89b73b5c95beb4859e42.tar.bz2
Fix return code for __libc_signal_* functions
The functions do not fail regardless of the argument value. Also, for Linux the return value is not correct on some platforms due the missing usage of INTERNAL_SYSCALL_ERROR_P / INTERNAL_SYSCALL_ERRNO macros. Checked on x86_64-linux-gnu, i686-linux-gnu, and sparc64-linux-gnu.
-rw-r--r--sysdeps/generic/internal-signals.h12
-rw-r--r--sysdeps/unix/sysv/linux/internal-signals.h18
2 files changed, 15 insertions, 15 deletions
diff --git a/sysdeps/generic/internal-signals.h b/sysdeps/generic/internal-signals.h
index a515e3e..41c24dc 100644
--- a/sysdeps/generic/internal-signals.h
+++ b/sysdeps/generic/internal-signals.h
@@ -34,28 +34,28 @@ __clear_internal_signals (sigset_t *set)
{
}
-static inline int
+static inline void
__libc_signal_block_all (sigset_t *set)
{
sigset_t allset;
__sigfillset (&allset);
- return __sigprocmask (SIG_BLOCK, &allset, set);
+ __sigprocmask (SIG_BLOCK, &allset, set);
}
-static inline int
+static inline void
__libc_signal_block_app (sigset_t *set)
{
sigset_t allset;
__sigfillset (&allset);
__clear_internal_signals (&allset);
- return __sigprocmask (SIG_BLOCK, &allset, set);
+ __sigprocmask (SIG_BLOCK, &allset, set);
}
/* Restore current process signal mask. */
-static inline int
+static inline void
__libc_signal_restore_set (const sigset_t *set)
{
- return __sigprocmask (SIG_SETMASK, set, NULL);
+ __sigprocmask (SIG_SETMASK, set, NULL);
}
diff --git a/sysdeps/unix/sysv/linux/internal-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h
index a496c71..2932e21 100644
--- a/sysdeps/unix/sysv/linux/internal-signals.h
+++ b/sysdeps/unix/sysv/linux/internal-signals.h
@@ -59,32 +59,32 @@ static const sigset_t sigall_set = {
};
/* Block all signals, including internal glibc ones. */
-static inline int
+static inline void
__libc_signal_block_all (sigset_t *set)
{
INTERNAL_SYSCALL_DECL (err);
- return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &sigall_set,
- set, _NSIG / 8);
+ INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_BLOCK, &sigall_set, set,
+ _NSIG / 8);
}
/* Block all application signals (excluding internal glibc ones). */
-static inline int
+static inline void
__libc_signal_block_app (sigset_t *set)
{
sigset_t allset = sigall_set;
__clear_internal_signals (&allset);
INTERNAL_SYSCALL_DECL (err);
- return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_BLOCK, &allset,
- set, _NSIG / 8);
+ INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_BLOCK, &allset, set,
+ _NSIG / 8);
}
/* Restore current process signal mask. */
-static inline int
+static inline void
__libc_signal_restore_set (const sigset_t *set)
{
INTERNAL_SYSCALL_DECL (err);
- return INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, set, NULL,
- _NSIG / 8);
+ INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_SETMASK, set, NULL,
+ _NSIG / 8);
}
/* Used to communicate with signal handler. */