On Tue, Sep 7, 2021 at 8:41 PM Zhao Gongyi wrote: > When fork() failed and transfer the return value(-1) to kill(), > kill(-1, SIGSTOP) would freeze the system, so it is very serious > in this cases and should be avoided. > > Signed-off-by: Zhao Gongyi > --- > .../conformance/interfaces/clock_nanosleep/1-5.c | 3 +++ > .../conformance/interfaces/nanosleep/3-2.c | 3 +++ > .../conformance/interfaces/sigaction/10-1.c | 3 +++ > .../conformance/interfaces/sigaction/11-1.c | 3 +++ > .../conformance/interfaces/sigaction/9-1.c | 3 +++ > 5 files changed, 15 insertions(+) > > diff --git > a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c > b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c > index 46f26163d..a87585884 100644 > --- > a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c > +++ > b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c > @@ -48,6 +48,9 @@ int main(void) > return CHILDFAIL; > } > return CHILDFAIL; > + } else if (pid < 0) { > + printf("fork() did not return success\n"); > + return PTS_UNRESOLVED; > Can we do the error check following the fork() instantly? Insert pid<0 with a 'else if' looks a bit strange here. Normally convention like: pid = fork(); if (pid < 0) do error handle ... -- Regards, Li Wang