|
From: Cyril H. <su...@li...> - 2013-05-14 11:21:18
|
The branch, master, has been updated
via e68ce79f8fef5617b1190be5ce88ee588135d5f0 (commit)
via c5532e498eadde47b4a41186c63937953a035648 (commit)
from 023f90b37de31039c5059283e16920b3e42cb0e3 (commit)
- Log -----------------------------------------------------------------
commit e68ce79f8fef5617b1190be5ce88ee588135d5f0
Author: Jan Stancek <jst...@re...>
Date: Tue May 14 13:11:45 2013 +0200
syscalls/cacheflush01: remove define of __NR_cacheflush
After including linux_syscall_numbers.h __NR_cacheflush
is guaranteed to be defined, redefining it to 0 collides
with __NR_read and testcase fails.
Signed-off-by: Jan Stancek <jst...@re...>
commit c5532e498eadde47b4a41186c63937953a035648
Author: Jan Stancek <jst...@re...>
Date: Tue May 14 11:59:33 2013 +0200
testcases/kernel: initialize fields of sigaction struct
Uninitialized fields of sigaction struct like sa_flags or
sa_mask can cause sporadic issues.
Signed-off-by: Jan Stancek <jst...@re...>
-----------------------------------------------------------------------
Summary of changes:
include/ltp_signal.h | 1 +
testcases/kernel/io/direct_io/diotest4.c | 2 ++
.../kernel/syscalls/cacheflush/cacheflush01.c | 4 +---
testcases/kernel/syscalls/fcntl/fcntl16.c | 1 +
testcases/kernel/syscalls/ioctl/ioctl02.c | 2 ++
testcases/kernel/syscalls/llseek/llseek01.c | 2 ++
testcases/kernel/syscalls/ptrace/ptrace01.c | 2 ++
testcases/kernel/syscalls/ptrace/ptrace02.c | 2 ++
testcases/kernel/syscalls/readdir/readdir02.c | 2 ++
9 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/include/ltp_signal.h b/include/ltp_signal.h
index a1beaf0..95134e9 100644
--- a/include/ltp_signal.h
+++ b/include/ltp_signal.h
@@ -81,6 +81,7 @@ static inline int sig_initial(int sig)
struct sigaction act, oact;
act.sa_handler = handler_h;
+ act.sa_flags = 0;
/* Clear out the signal set. */
if (sigemptyset(&act.sa_mask) < 0) {
/* Add the signal to the mask set. */
diff --git a/testcases/kernel/io/direct_io/diotest4.c b/testcases/kernel/io/direct_io/diotest4.c
index 50ec535..10281bf 100644
--- a/testcases/kernel/io/direct_io/diotest4.c
+++ b/testcases/kernel/io/direct_io/diotest4.c
@@ -591,6 +591,8 @@ static void setup(void)
tst_tmpdir();
act.sa_handler = SIG_IGN;
+ act.sa_flags = 0;
+ sigemptyset(&act.sa_mask);
(void)sigaction(SIGXFSZ, &act, NULL);
sprintf(filename, "testdata-4.%ld", syscall(__NR_gettid));
diff --git a/testcases/kernel/syscalls/cacheflush/cacheflush01.c b/testcases/kernel/syscalls/cacheflush/cacheflush01.c
index d4d353f..9c02f0a 100644
--- a/testcases/kernel/syscalls/cacheflush/cacheflush01.c
+++ b/testcases/kernel/syscalls/cacheflush/cacheflush01.c
@@ -48,11 +48,9 @@
#include "usctest.h"
#include "linux_syscall_numbers.h"
-#if defined __NR_cacheflush && __NR_cacheflush > 0
+#if __NR_cacheflush != __LTP__NR_INVALID_SYSCALL
#include <asm/cachectl.h>
#else
-/* Fake linux_syscall_numbers.h */
-#define __NR_cacheflush 0
#ifndef ICACHE
#define ICACHE (1<<0) /* flush instruction cache */
#endif
diff --git a/testcases/kernel/syscalls/fcntl/fcntl16.c b/testcases/kernel/syscalls/fcntl/fcntl16.c
index d985ae1..8bdb6b5 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl16.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl16.c
@@ -310,6 +310,7 @@ void dochild(int kid)
struct sigaction sact;
sact.sa_flags = 0;
sact.sa_handler = catch_int;
+ sigemptyset(&sact.sa_mask);
(void)sigaction(SIGUSR1, &sact, NULL);
/* Lock should succeed after blocking and parent releases lock */
diff --git a/testcases/kernel/syscalls/ioctl/ioctl02.c b/testcases/kernel/syscalls/ioctl/ioctl02.c
index d9cdc8a..794a9b0 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl02.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl02.c
@@ -213,6 +213,7 @@ void do_child_uclinux(void)
/* Set up the signal handlers again */
act.sa_handler = (void *)sigterm_handler;
act.sa_flags = 0;
+ sigemptyset(&act.sa_mask);
(void)sigaction(SIGTERM, &act, 0);
/* Run the normal child */
@@ -457,6 +458,7 @@ static void setup(void)
/* Set up the signal handlers */
act.sa_handler = (void *)sigterm_handler;
act.sa_flags = 0;
+ sigemptyset(&act.sa_mask);
(void)sigaction(SIGTERM, &act, 0);
act.sa_handler = (void *)sigusr1_handler;
diff --git a/testcases/kernel/syscalls/llseek/llseek01.c b/testcases/kernel/syscalls/llseek/llseek01.c
index 94f61ad..151e200 100644
--- a/testcases/kernel/syscalls/llseek/llseek01.c
+++ b/testcases/kernel/syscalls/llseek/llseek01.c
@@ -189,6 +189,8 @@ void setup()
TEST_PAUSE;
act.sa_handler = SIG_IGN;
+ act.sa_flags = 0;
+ sigemptyset(&act.sa_mask);
if (sigaction(SIGXFSZ, &act, NULL) == -1) {
tst_brkm(TFAIL, NULL, "sigaction() Failed to ignore SIGXFSZ");
tst_exit();
diff --git a/testcases/kernel/syscalls/ptrace/ptrace01.c b/testcases/kernel/syscalls/ptrace/ptrace01.c
index 2961fd2..cbdd9ca 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace01.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace01.c
@@ -138,6 +138,7 @@ int main(int ac, char **av)
if (i == 1) {
parent_act.sa_handler = parent_handler;
parent_act.sa_flags = SA_RESTART;
+ sigemptyset(&parent_act.sa_mask);
if ((sigaction(SIGUSR2, &parent_act, NULL))
== -1) {
@@ -228,6 +229,7 @@ void do_child()
child_act.sa_handler = child_handler;
}
child_act.sa_flags = SA_RESTART;
+ sigemptyset(&child_act.sa_mask);
if ((sigaction(SIGUSR2, &child_act, NULL)) == -1) {
tst_resm(TWARN, "sigaction() failed in child");
diff --git a/testcases/kernel/syscalls/ptrace/ptrace02.c b/testcases/kernel/syscalls/ptrace/ptrace02.c
index 3991ecf..2075204 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace02.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace02.c
@@ -138,6 +138,7 @@ int main(int ac, char **av)
if (i == 1) {
parent_act.sa_handler = parent_handler;
parent_act.sa_flags = SA_RESTART;
+ sigemptyset(&parent_act.sa_mask);
if ((sigaction(SIGUSR2, &parent_act, NULL))
== -1) {
@@ -229,6 +230,7 @@ void do_child()
child_act.sa_handler = child_handler;
}
child_act.sa_flags = SA_RESTART;
+ sigemptyset(&child_act.sa_mask);
if ((sigaction(SIGUSR2, &child_act, NULL)) == -1) {
tst_resm(TWARN, "sigaction() failed in child");
diff --git a/testcases/kernel/syscalls/readdir/readdir02.c b/testcases/kernel/syscalls/readdir/readdir02.c
index 85fe510..e44c722 100644
--- a/testcases/kernel/syscalls/readdir/readdir02.c
+++ b/testcases/kernel/syscalls/readdir/readdir02.c
@@ -181,6 +181,8 @@ void setup()
tst_sig(NOFORK, DEF_HANDLER, cleanup);
act.sa_handler = sigsegv_handler;
+ act.sa_flags = 0;
+ sigemptyset(&act.sa_mask);
(void)sigaction(SIGSEGV, &act, NULL);
TEST_PAUSE;
hooks/post-receive
--
ltp
|