ATF-log archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: #53: atf-run hangs if child of test program gets stuck



#53: atf-run hangs if child of test program gets stuck
----------------------+-----------------------------------------------------
  Reporter:  jmmv     |       Owner:  jmmv
      Type:  defect   |      Status:  new 
  Priority:  major    |   Milestone:  0.11
 Component:  atf-run  |     Version:      
Resolution:           |    Keywords:      
----------------------+-----------------------------------------------------

Comment (by Garrett Cooper <gcooper@...>):

 The test itself is written incorrectly. It should be something like:

 {{{
 #include <sys/wait.h>
 #include <unistd.h>
 #include <atf-c.h>

 ATF_TC_BODY(forkexit, tc)
 {
        int status;

        switch (fork()) {
        case 0:
                pause();
                exit(0);
                break;
        case -1:
                atf_tc_fail("fork");
                break;
        default:
                wait(&status);
                break;
        }
        exit(status);
 }
 }}}

-- 
Ticket URL: <http://www.julipedia.org/projects/atf/trac/ticket/53#comment:3>
Automated Testing Framework <http://www.NetBSD.org/~jmmv/atf/>
Automated Testing Framework


Home | Main Index | Thread Index | Old Index