[LTP] [PATCH] rt_sigaction: headers are included in a uniform way

Stanislav Kholmanskikh
2013-08-13T04:50:38Z

Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
---
include/ltp_signal.h | 17 ++++++++++++++++
.../kernel/syscalls/rt_sigaction/rt_sigaction02.c | 21 +------------------
.../kernel/syscalls/rt_sigaction/rt_sigaction03.c | 2 +
3 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/include/ltp_signal.h b/include/ltp_signal.h
index 95134e9..e6fb2e0 100644
--- a/include/ltp_signal.h
+++ b/include/ltp_signal.h
@@ -34,7 +34,24 @@
#include <stdio.h>
#include "config.h"

+/*
+ * For all but __mips__:
+ *
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
+ *
+ * For __mips__:
+ *
+ * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 4.
+ *
+ * See asm/compat.h under the kernel source for more details.
+ *
+ * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
+ */
+#if defined __mips__
+#define SIGSETSIZE 16
+#else
#define SIGSETSIZE (_NSIG / 8)
+#endif

#ifdef LTP_RT_SIG_TEST

diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
index 5beabef..0e2915e 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.c
@@ -46,28 +46,11 @@
#include <sys/syscall.h>
#include <string.h>

+#define LTP_RT_SIG_TEST
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
-
-/*
- * For all but __mips__:
- *
- * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 2.
- *
- * For __mips__:
- *
- * _COMPAT_NSIG / _COMPAT_NSIG_BPW == 4.
- *
- * See asm/compat.h under the kernel source for more details.
- *
- * Multiply that by a fudge factor of 4 and you have your SIGSETSIZE.
- */
-#if defined (__mips__)
-#define SIGSETSIZE 16
-#else
-#define SIGSETSIZE 8
-#endif
+#include "ltp_signal.h"

#define INVAL_STRUCT -1

diff --git a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
index 646c37d..b160f2b 100644
--- a/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
+++ b/testcases/kernel/syscalls/rt_sigaction/rt_sigaction03.c
@@ -46,9 +46,11 @@
#include <sys/syscall.h>
#include <string.h>

+#define LTP_RT_SIG_TEST
#include "test.h"
#include "usctest.h"
#include "linux_syscall_numbers.h"
+#include "ltp_signal.h"

#define INVAL_SIGSETSIZE -1

--
1.7.1