<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Gongyi,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 19, 2021 at 1:05 PM zhao gongyi <<a href="mailto:zhaogongyi@huawei.com">zhaogongyi@huawei.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We need to clean up temporary file /tmp/fork-11-1-XXXXXX which created by mkstemp.<br>
<br>
Signed-off-by: zhao gongyi <<a href="mailto:zhaogongyi@huawei.com" target="_blank">zhaogongyi@huawei.com</a>><br>
---<br>
 .../open_posix_testsuite/conformance/interfaces/fork/11-1.c     | 2 ++<br>
 1 file changed, 2 insertions(+)<br>
<br>
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c<br>
index a43bc274c..e9b18958c 100644<br>
--- a/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c<br>
+++ b/testcases/open_posix_testsuite/conformance/interfaces/fork/11-1.c<br>
@@ -79,6 +79,8 @@ int main(void)<br>
                return result;<br>
        }<br>
<br>
+       unlink(path_template);<br></blockquote><div><br></div>Why do we need to delete the tempfile before acquiring a lock?</div><div class="gmail_quote"><div class="gmail_default" style="font-size:small">Or did you mean doing this after the testing(in the cleanup phase).</div><div class="gmail_quote"><br></div><div class="gmail_default" style="font-size:small">BTW, seems the child report a wrong status of the locked file, while</div><div class="gmail_default" style="font-size:small">fcntl(fd, F_SETLK, &fl) return -1 and sets errno to EACCES or EAGAIN,</div><div class="gmail_default" style="font-size:small">shouldn't that mean the file already been locked by the parent?</div><br><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
        if (fcntl(fd, F_SETLK, &fl) == -1) {<br>
                printf("Could not set initial lock: %s (%d)\n",<br>
                       strerror(errno), errno);<br>
--<br>
2.17.1<br>
<br>
<br>
-- <br>
Mailing list info: <a href="https://lists.linux.it/listinfo/ltp" rel="noreferrer" target="_blank">https://lists.linux.it/listinfo/ltp</a><br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>