From: Karel Zak <kzak@redhat.com>
To: Namhyung Kim <namhyung@gmail.com>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 2/2] libmount: Fix mnt_context_is_child()
Date: Fri, 11 Oct 2013 10:55:24 +0200 [thread overview]
Message-ID: <20131011085524.GD14457@x2.net.home> (raw)
In-Reply-To: <1381331829-9791-2-git-send-email-namhyung@gmail.com>
On Thu, Oct 10, 2013 at 12:17:09AM +0900, Namhyung Kim wrote:
> It should check if fork (mount -F) is enabled.
>
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> ---
> libmount/src/context.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libmount/src/context.c b/libmount/src/context.c
> index 04eb286..a4d9824 100644
> --- a/libmount/src/context.c
> +++ b/libmount/src/context.c
> @@ -387,7 +387,7 @@ int mnt_context_is_parent(struct libmnt_context *cxt)
> */
> int mnt_context_is_child(struct libmnt_context *cxt)
> {
> - return !mnt_context_is_fork(cxt) && cxt->pid;
> + return mnt_context_is_fork(cxt) && cxt->pid;
> }
No, the code is correct, the function docs is incorrect. The fork
flag is disabled in all children (see mnt_fork_context()) to avoid
recursive forking.
I have fixed the function comment.
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2013-10-11 8:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-09 15:17 [PATCH 1/2] libmount: Fix typo in comment Namhyung Kim
2013-10-09 15:17 ` [PATCH 2/2] libmount: Fix mnt_context_is_child() Namhyung Kim
2013-10-11 8:55 ` Karel Zak [this message]
2013-10-12 3:50 ` Namhyung Kim
2013-10-11 8:53 ` [PATCH 1/2] libmount: Fix typo in comment Karel Zak
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=20131011085524.GD14457@x2.net.home \
--to=kzak@redhat.com \
--cc=namhyung@gmail.com \
--cc=util-linux@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox