From: zhaogongyi via ltp <ltp@lists.linux.it>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: "ltp@lists.linux.it" <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] accept02: Add SAFE_FORK to clean CLOSE_WAIT fds
Date: Thu, 24 Mar 2022 02:27:50 +0000 [thread overview]
Message-ID: <45ad8c7bf0c040f69346499d9ef72230@huawei.com> (raw)
Hi Cyril,
Thanks for your review! Yes, I cann't the clone_server_sockfd is not closed before,
and I will resubmit a patch, please see: https://patchwork.ozlabs.org/project/ltp/patch/20220324022455.245300-1-zhaogongyi@huawei.com/
Best regards,
Gongyi
>
> Hi!
> As far as I can tell we should rather close the fd returned from the
> accept() call like this:
>
> diff --git a/testcases/kernel/syscalls/accept/accept02.c
> b/testcases/kernel/syscalls/accept/accept02.c
> index 12a1e3ca3..b2d27a260 100644
> --- a/testcases/kernel/syscalls/accept/accept02.c
> +++ b/testcases/kernel/syscalls/accept/accept02.c
> @@ -68,6 +68,8 @@ static void *server_thread(void *arg)
> TEST(setsockopt(clone_server_sockfd, SOL_IP,
> MCAST_LEAVE_GROUP,
> mc_group, mc_group_len));
>
> + SAFE_CLOSE(clone_server_sockfd);
> +
> if (TST_RET != -1)
> tst_res(TFAIL, "Multicast group was copied!");
> else if (TST_ERR == EADDRNOTAVAIL)
>
>
> --
> Cyril Hrubis
> chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2022-03-24 2:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 2:27 zhaogongyi via ltp [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-03-23 9:49 [LTP] [PATCH] accept02: Add SAFE_FORK to clean CLOSE_WAIT fds Zhao Gongyi via ltp
2022-03-23 15:06 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45ad8c7bf0c040f69346499d9ef72230@huawei.com \
--to=ltp@lists.linux.it \
--cc=chrubis@suse.cz \
--cc=zhaogongyi@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.