[LTP] [PATCH] quotactl01: Fix tst_resm() format causing crash

Geert Uytterhoeven
2009-08-27T15:04:58Z

When the quotactl syscall fails, quotactl01 crashes with a segmentation fault
due to an incorrect printf()-style format.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
---
testcases/kernel/syscalls/quotactl/quotactl01.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 6800a25..0be4fd5 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -147,7 +147,7 @@ int main(int ac, char **av) {
for (i = 0; i <= 7; i++){
TEST(retval = syscall(__NR_quotactl, cmd[i], (const char *)NULL, id, (caddr_t)NULL));
if(TEST_RETURN != 0){
- tst_resm(TFAIL, "%s failed - errno = %d : %s ...cmderror=%s", TCID, TEST_ERRNO, strerror(TEST_ERRNO),cmd[i]);
+ tst_resm(TFAIL, "%s failed - errno = %d : %s ...cmd=0x%x", TCID, TEST_ERRNO, strerror(TEST_ERRNO), cmd[i]);
}else{
tst_resm(TPASS, "quotactl call succeeded");
}
--
1.6.2.4

With kind regards,

Geert Uytterhoeven
Software Architect
Techsoft Centre

Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010