Commit 350d216d authored by Ivan Orlov's avatar Ivan Orlov Committed by Shuah Khan

selftests: Refactor 'peeksiginfo' ptrace test part

peeksiginfo creates an array of 10 instances of 'siginfo_t',
but actually uses only one. This patch will reduce amount
of memory on the stack used by the peeksiginfo test.
Signed-off-by: default avatarIvan Orlov <ivan.orlov0322@gmail.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent e1e17d7d
...@@ -151,7 +151,7 @@ int check_direct_path(pid_t child, int shared, int nr) ...@@ -151,7 +151,7 @@ int check_direct_path(pid_t child, int shared, int nr)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
siginfo_t siginfo[SIGNR]; siginfo_t siginfo;
int i, exit_code = 1; int i, exit_code = 1;
sigset_t blockmask; sigset_t blockmask;
pid_t child; pid_t child;
...@@ -176,13 +176,13 @@ int main(int argc, char *argv[]) ...@@ -176,13 +176,13 @@ int main(int argc, char *argv[])
/* Send signals in process-wide and per-thread queues */ /* Send signals in process-wide and per-thread queues */
for (i = 0; i < SIGNR; i++) { for (i = 0; i < SIGNR; i++) {
siginfo->si_code = TEST_SICODE_SHARE; siginfo.si_code = TEST_SICODE_SHARE;
siginfo->si_int = i; siginfo.si_int = i;
sys_rt_sigqueueinfo(child, SIGRTMIN, siginfo); sys_rt_sigqueueinfo(child, SIGRTMIN, &siginfo);
siginfo->si_code = TEST_SICODE_PRIV; siginfo.si_code = TEST_SICODE_PRIV;
siginfo->si_int = i; siginfo.si_int = i;
sys_rt_tgsigqueueinfo(child, child, SIGRTMIN, siginfo); sys_rt_tgsigqueueinfo(child, child, SIGRTMIN, &siginfo);
} }
if (sys_ptrace(PTRACE_ATTACH, child, NULL, NULL) == -1) if (sys_ptrace(PTRACE_ATTACH, child, NULL, NULL) == -1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment