Hi,

[Patch 1/1] Patch for fixing the openposix_gettime_speculative_6_1
testcase's segment fault

-modified the file
testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c


Signed-off-by:  fredrick he <[email protected]>

diff -pur
ltp-full-20081031.orig//testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
ltp-full-20081031/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
---
ltp-full-20081031.orig//testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
   2005-06-04
00:36:28.000000000 +0800
+++
ltp-full-20081031/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
 2009-03-31
11:31:28.000000000 +0800
@@ -21,8 +21,8 @@ int main(int argc, char *argv[])
 {
        timer_t tid;
        struct itimerspec its;
-
-       tid = (timer_t) BOGUSTID;
+    int tval=BOGUSTID;
+       tid = (timer_t) &tval;
        if (timer_gettime(tid, &its) == -1) {
                if (EINVAL == errno) {
                        printf("fcn returned -1 and errno==EINVAL\n");

-- 

Fan Fredrick He
R&D OPS QA Beijing PRC
Room 3603, Beijing Fortune Plaza, Office Tower A, No.7 Dongsanhuan
Zhonglu, Chaoyang District, Beijing, P.R., 100020
SUSE LINUX Products
[email protected]
Mainland-Mobile (86) 13661278596

diff -pur 
ltp-full-20081031.orig//testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
 
ltp-full-20081031/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
--- 
ltp-full-20081031.orig//testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
       2005-06-04 00:36:28.000000000 +0800
+++ 
ltp-full-20081031/testcases/open_posix_testsuite/conformance/interfaces/timer_gettime/speculative/6-1.c
     2009-03-31 11:31:28.000000000 +0800
@@ -21,8 +21,8 @@ int main(int argc, char *argv[])
 {
        timer_t tid;
        struct itimerspec its;
-
-       tid = (timer_t) BOGUSTID;
+    int tval=BOGUSTID;
+       tid = (timer_t) &tval;
        if (timer_gettime(tid, &its) == -1) {
                if (EINVAL == errno) {
                        printf("fcn returned -1 and errno==EINVAL\n");
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to