On 06/11/2011 01:46 AM, tangchen wrote:
> 
> Hi~
> 
> I got the following FAIL, and this FAIL often happens when running the fork13 
> test with -C option.
> See this: 
> 
> ./fork13 -c 3 -I 1
> fork13      1  TPASS  :  5729 pids forked, all passed
> fork13      1  TFAIL  :  Wait return value: expected pid=10511, got 32132, 
> iteration 2957.
> fork13      1  TPASS  :  2755 pids forked, all passed
> 
> That is because the first process is the father of the other two processes, 
> and when the father calls wait(), any of the children could be waited.
> So I think we should use waitpid() instead of wait().
> 
> Here is the patch.
> Please comment!

Hi, I tested with this patch and it worked well.

Thanks,
Caspar

> 
> Signed-off-by: Tang Chen <[email protected]>
> ---
>  testcases/kernel/syscalls/fork/fork13.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/fork/fork13.c 
> b/testcases/kernel/syscalls/fork/fork13.c
> index 4804ea1..7fcf3d1 100644
> --- a/testcases/kernel/syscalls/fork/fork13.c
> +++ b/testcases/kernel/syscalls/fork/fork13.c
> @@ -114,7 +114,7 @@ void check(void)
>                       }
>                       last_pid = pid;
>  
> -                     reaped = wait(&status);
> +                     reaped = waitpid(pid, &status, 0);
>                       if (reaped != pid) {
>                               tst_resm(TFAIL,
>                                       "Wait return value: expected pid=%d, "


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to