libmount: Fix typo in comment
PATCH 1/2 libmount: Fix typo in comment
s/MNT_OMASK_/MNT_OMODE_/
--- libmount/src/context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
libmount/src/context.c +2 -2
@@ -229,7 +229,7 @@ int mnt_context_is_restricted(struct libmnt_context *cxt)/** * mnt_context_set_optsmode * @cxt: mount context -* @mode: MNT_OMASK_* flags +* @mode: MNT_OMODE_* flags * * Controls how to use mount optionssource and target paths from fstab/mtab. *
@@ -276,7 +276,7 @@ int mnt_context_set_optsmode(struct libmnt_context *cxt, int mode)* mnt_context_get_optsmode * @cxt: mount context * -* Returns: MNT_OMASK_* mask or zero. +* Returns: MNT_OMODE_* mask or zero. */ int mnt_context_get_optsmode (struct libmnt_context *cxt)
Signature · 1 line
1.7.9.2
PATCH 2/2 libmount: Fix mnt_context_is_child()
It should check if fork (mount -F) is enabled.
--- libmount/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libmount/src/context.c +1 -1
@@ -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; }/**
Signature · 1 line
1.7.9.2
Karel Zak
maintainerRe: [PATCH 2/2] libmount: Fix mnt_context_is_child()
Quoted 12 lines · Namhyung Kim
It should check if fork (mount -F) is enabled.
Signed-off-by Namhyung Kim <[email protected]>--- libmount/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libmount/src/context.c +0
-0
libmount/src/context.c int mnt_context_is_parent(struct libmnt_context *cxt) · line 391
Quoted 6 lines
libmount/src/context.c +1
-1@@ -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
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com
Re: [PATCH 2/2] libmount: Fix mnt_context_is_child()
Hi Karel,
2013-10-11 (금), 10:55 +0200, Karel Zak:
Quoted 24 lines · Namhyung Kim
Quoted 12 lines
It should check if fork (mount -F) is enabled.
Signed-off-by Namhyung Kim <[email protected]>--- libmount/src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)libmount/src/context.c +0
-0libmount/src/context.c int mnt_context_is_parent(struct libmnt_context *cxt) · line 391
Quoted 6 lines
libmount/src/context.c +1
-1@@ -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.
Quoted 1 line
I have fixed the function comment.
Okay, thanks for the explanation.
Signature · 2 lines
Regards, Namhyung Kim
Quoted 2 lines · Namhyung Kim
libmount/src/context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com