[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-list
Subject:    [LTP] [PATCH] get_robust_list01 returns "random" value when
From:       Daniel Gollub <dgollub () suse ! de>
Date:       2008-11-06 18:13:25
Message-ID: 200811061913.25512.dgollub () suse ! de
[Download RAW message or body]

Hi,

on SLES10 SP2 __NR_get_robust_list is not defined and cause following compiler
warning:

---->8---------
make[4]: Entering directory \
`/usr/src/packages/BUILD/ltp-full-20081031/testcases/kernel/syscalls/get_robust_list' \
cc -fmessage-length=0 -D_FORTIFY_SOURCE=2 -O2 -g -Wall -fmessage-length=0 \
-D_FORTIFY_SOURCE=2 -O2 -g -I../../include -g -Wall -I../../../../include -Wall    \
                get_robust_list01.c  
-L../../../../lib -lltp
 -o get_robust_list01
get_robust_list01.c: In function 'main':
get_robust_list01.c:252: warning: control reaches end of non-void function
make[4]: Leaving directory \
                `/usr/src/packages/BUILD/ltp-full-20081031/testcases/kernel/syscalls/get_robust_list'
                
----8<---------

And cause "unexpected" return value:

----8<---------
x86_64:~/:[1]# /usr/lib64/ltp/testcases/bin/get_robust_list01
get_robust_list: system call not available
x86_64:~/:[43]# echo $?
43
x86_64:~/:[0]# /usr/lib64/ltp/testcases/bin/get_robust_list01 | wc -c
43
---->8---------

Attached patch avoids "random"/43 return value.

Signed-off-by: Daniel Gollub <dgollub@suse.de>

---
 testcases/kernel/syscalls/get_robust_list/get_robust_list01.c |   11 +++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: ltp-full-20081031/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
 ===================================================================
--- ltp-full-20081031.orig/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
                
+++ ltp-full-20081031/testcases/kernel/syscalls/get_robust_list/get_robust_list01.c
@@ -49,6 +49,12 @@
 #include <sys/syscall.h>
 #include <sys/types.h>
 
+#include "test.h"
+#include "usctest.h"
+
+char *TCID = "get_robust_list01";    /* test program identifier.              */
+int TST_TOTAL = 5;                   /* total number of tests in this file.   */
+
 #ifdef __NR_get_robust_list
 
 struct robust_list {
@@ -61,8 +67,6 @@ struct robust_list_head {
     struct robust_list *list_op_pending;
 };
 
-#include "test.h"
-#include "usctest.h"
 
 extern int Tst_count;                /* counter for tst_xxx routines.         */
 
@@ -248,7 +252,8 @@ cleanup(void)
 
 int main()
 {
-	puts("get_robust_list: system call not available");
+	tst_resm(TCONF, "get_robust_list: system call not available");
+	tst_exit();
 }
 
 #endif


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic