The case failed sporadically, because the execution time is short.
Furthermore, when the execution time is short, if the child process cannot
set its priority, the case is meaningless.

Signed-off-by: Peng Haitao <[email protected]>
---
 .../conformance/interfaces/sched_setparam/2-2.c    |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git 
a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c 
b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c
index 2b71893..d64d851 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_setparam/2-2.c
@@ -48,8 +48,8 @@
 # include <sys/pstat.h>
 #endif
 
-#define NB_LOOP         20000000
-#define NB_LOOP_CHILD  200000000 /* shall be much greater than NB_LOOP */
+#define NB_LOOP         2000000000L
+#define NB_LOOP_CHILD  20000000000L /* shall be much greater than NB_LOOP */
 
 #define ACCEPTABLE_RATIO 2.0
 
@@ -58,7 +58,7 @@
 #define STDERR 2
 
 int nb_child;   /* Number of child processes == number of CPUs */
-int count = 0;
+long long int count = 0;
 int the_pipe[2];
 
 /* Get the number of CPUs */
@@ -88,7 +88,7 @@ int get_ncpu() {
 }
 
 void child_process(int id) {
-       int i;
+       long long int i;
        struct sched_param param;
 
        if (id == nb_child-1) {
@@ -107,14 +107,14 @@ void sigterm_handler(int signum) {
        dup2(the_pipe[1],STDOUT);
        close(the_pipe[1]);
 
-       printf("*%i*", count);
+       printf("*%lli*", count);
        fflush(stdout);
 
        exit(0);
 }
 
 int main() {
-        int child_count, i;
+        long long int child_count, i;
        struct sched_param param;
        int *child_pid;
        float ratio;
@@ -187,7 +187,7 @@ int main() {
                return PTS_UNRESOLVED;
        }
 
-       while (scanf("*%i*",&child_count) == 0)
+       while (scanf("*%lli*",&child_count) == 0)
                sched_yield();
 
        for (i = 0; i < (nb_child-1); i++) {
@@ -211,4 +211,4 @@ int main() {
                return PTS_UNRESOLVED;
        }
 
-}
\ No newline at end of file
+}
-- 
1.7.1

-- 
Best Regards,
Peng Haitao


------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to