<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:宋体;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:微软雅黑;
        panose-1:2 11 5 3 2 2 4 2 2 4;}
@font-face
        {font-family:"\@宋体";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@微软雅黑";
        panose-1:2 11 5 3 2 2 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:宋体;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Li,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">I have modified the patch as your review, please see:
<a href="https://patchwork.ozlabs.org/project/ltp/patch/20210920221212.8478-1-zhaogongyi@huawei.com/">
https://patchwork.ozlabs.org/project/ltp/patch/20210920221212.8478-1-zhaogongyi@huawei.com/</a><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks so much!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"微软雅黑",sans-serif">发件人<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"微软雅黑",sans-serif"> Li Wang [mailto:liwang@redhat.com]
<br>
</span><b><span style="font-size:11.0pt;font-family:"微软雅黑",sans-serif">发送时间<span lang="EN-US">:</span></span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"微软雅黑",sans-serif"> 2021</span><span style="font-size:11.0pt;font-family:"微软雅黑",sans-serif">年<span lang="EN-US">9</span>月<span lang="EN-US">8</span>日<span lang="EN-US">
 11:30<br>
</span><b>收件人<span lang="EN-US">:</span></b><span lang="EN-US"> zhaogongyi <zhaogongyi@huawei.com><br>
</span><b>抄送<span lang="EN-US">:</span></b><span lang="EN-US"> LTP List <ltp@lists.linux.it><br>
</span><b>主题<span lang="EN-US">:</span></b><span lang="EN-US"> Re: [LTP] [PATCH] open_posix: Add failure handling of fork()<o:p></o:p></span></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">On Tue, Sep 7, 2021 at 8:41 PM Zhao Gongyi <<a href="mailto:zhaogongyi@huawei.com">zhaogongyi@huawei.com</a>> wrote:<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><span lang="EN-US">When fork() failed and transfer the return value(-1) to kill(),<br>
kill(-1, SIGSTOP) would freeze the system, so it is very serious<br>
in this cases and should be avoided.<br>
<br>
Signed-off-by: Zhao Gongyi <<a href="mailto:zhaogongyi@huawei.com" target="_blank">zhaogongyi@huawei.com</a>><br>
---<br>
 .../conformance/interfaces/clock_nanosleep/1-5.c               | 3 +++<br>
 .../conformance/interfaces/nanosleep/3-2.c                     | 3 +++<br>
 .../conformance/interfaces/sigaction/10-1.c                    | 3 +++<br>
 .../conformance/interfaces/sigaction/11-1.c                    | 3 +++<br>
 .../conformance/interfaces/sigaction/9-1.c                     | 3 +++<br>
 5 files changed, 15 insertions(+)<br>
<br>
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<br>
index 46f26163d..a87585884 100644<br>
--- a/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c<br>
+++ b/testcases/open_posix_testsuite/conformance/interfaces/clock_nanosleep/1-5.c<br>
@@ -48,6 +48,9 @@ int main(void)<br>
                        return CHILDFAIL;<br>
                }<br>
                return CHILDFAIL;<br>
+       } else if (pid < 0) {<br>
+               printf("fork() did not return success\n");<br>
+               return PTS_UNRESOLVED;<o:p></o:p></span></p>
</blockquote>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Can we do the error check following the fork() instantly?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Insert pid<0 with a 'else if' looks a bit strange here.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Normally convention like:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">pid = fork();<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"> if (pid < 0)<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">    do error handle ...<o:p></o:p></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-US">-- <o:p></o:p></span></p>
<div>
<div>
<div>
<p class="MsoNormal"><span lang="EN-US">Regards,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-US">Li Wang<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>