Skip to contentSkip to conversation

libmount: Fix typo in comment

PATCH Applied Namhyung Kim 2 participants 5 messages Oct 9, 2013 – Oct 12, 2013 Util-Linux package

lore
Share & tools
lore
#0 lore raw

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
index 0f8f112..04eb286 100644
@@ -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
#1 lore raw

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
index 04eb286..a4d9824 100644
@@ -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
maintainer
#2 lore raw

Re: [PATCH 2/2] libmount: Fix mnt_context_is_child()

In reply to Namhyung Kim
Quoted 12 lines · Namhyung Kim

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 +0 -0
index 04eb286..a4d9824 100644

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
#3 lore raw

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.

---
 libmount/src/context.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmount/src/context.c +0 -0
index 04eb286..a4d9824 100644

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.

Quoted 1 line

I have fixed the function comment.

Okay, thanks for the explanation.

Signature · 2 lines
Regards,
Namhyung Kim