Commit 0c49ad41 authored by Stas Sergeev's avatar Stas Sergeev Committed by Linus Torvalds

tools/testing/selftests/sigaltstack/sas.c: improve output of sigaltstack testcase

Currently it uses %i for bitmasks, which makes it difficult to properly
decode the values.  Use %x instead.

Link: http://lkml.kernel.org/r/b7b4c45d-2f21-de6c-d1c8-16c8386da27c@list.ruSigned-off-by: default avatarStas Sergeev <stsp@users.sourceforge.net>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 441398d3
...@@ -57,7 +57,7 @@ void my_usr1(int sig, siginfo_t *si, void *u) ...@@ -57,7 +57,7 @@ void my_usr1(int sig, siginfo_t *si, void *u)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (stk.ss_flags != SS_DISABLE) if (stk.ss_flags != SS_DISABLE)
printf("[FAIL]\tss_flags=%i, should be SS_DISABLE\n", printf("[FAIL]\tss_flags=%x, should be SS_DISABLE\n",
stk.ss_flags); stk.ss_flags);
else else
printf("[OK]\tsigaltstack is disabled in sighandler\n"); printf("[OK]\tsigaltstack is disabled in sighandler\n");
...@@ -122,7 +122,8 @@ int main(void) ...@@ -122,7 +122,8 @@ int main(void)
if (stk.ss_flags == SS_DISABLE) { if (stk.ss_flags == SS_DISABLE) {
printf("[OK]\tInitial sigaltstack state was SS_DISABLE\n"); printf("[OK]\tInitial sigaltstack state was SS_DISABLE\n");
} else { } else {
printf("[FAIL]\tInitial sigaltstack state was %i; should have been SS_DISABLE\n", stk.ss_flags); printf("[FAIL]\tInitial sigaltstack state was %x; "
"should have been SS_DISABLE\n", stk.ss_flags);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
...@@ -165,7 +166,7 @@ int main(void) ...@@ -165,7 +166,7 @@ int main(void)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (stk.ss_flags != SS_AUTODISARM) { if (stk.ss_flags != SS_AUTODISARM) {
printf("[FAIL]\tss_flags=%i, should be SS_AUTODISARM\n", printf("[FAIL]\tss_flags=%x, should be SS_AUTODISARM\n",
stk.ss_flags); stk.ss_flags);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
......
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