summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ptrace
diff options
context:
space:
mode:
authorIvan Orlov <ivan.orlov0322@gmail.com>2023-02-20 19:03:02 +0300
committerShuah Khan <skhan@linuxfoundation.org>2023-03-28 19:23:45 +0300
commit350d216dc2507daa03074a3079f0d654eadcac13 (patch)
tree7eb2a4618d2bd8ba9000d6bea8840f47bd167ebc /tools/testing/selftests/ptrace
parente1e17d7debf486fd3b757df9e009b8d109e4be43 (diff)
downloadlinux-350d216dc2507daa03074a3079f0d654eadcac13.tar.xz
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: Ivan Orlov <ivan.orlov0322@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/ptrace')
-rw-r--r--tools/testing/selftests/ptrace/peeksiginfo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/testing/selftests/ptrace/peeksiginfo.c b/tools/testing/selftests/ptrace/peeksiginfo.c
index 54900657eb44..a6884f66dc01 100644
--- a/tools/testing/selftests/ptrace/peeksiginfo.c
+++ b/tools/testing/selftests/ptrace/peeksiginfo.c
@@ -151,7 +151,7 @@ out:
int main(int argc, char *argv[])
{
- siginfo_t siginfo[SIGNR];
+ siginfo_t siginfo;
int i, exit_code = 1;
sigset_t blockmask;
pid_t child;
@@ -176,13 +176,13 @@ int main(int argc, char *argv[])
/* Send signals in process-wide and per-thread queues */
for (i = 0; i < SIGNR; i++) {
- siginfo->si_code = TEST_SICODE_SHARE;
- siginfo->si_int = i;
- sys_rt_sigqueueinfo(child, SIGRTMIN, siginfo);
+ siginfo.si_code = TEST_SICODE_SHARE;
+ siginfo.si_int = i;
+ sys_rt_sigqueueinfo(child, SIGRTMIN, &siginfo);
- siginfo->si_code = TEST_SICODE_PRIV;
- siginfo->si_int = i;
- sys_rt_tgsigqueueinfo(child, child, SIGRTMIN, siginfo);
+ siginfo.si_code = TEST_SICODE_PRIV;
+ siginfo.si_int = i;
+ sys_rt_tgsigqueueinfo(child, child, SIGRTMIN, &siginfo);
}
if (sys_ptrace(PTRACE_ATTACH, child, NULL, NULL) == -1)