summaryrefslogtreecommitdiffstats
path: root/libmount/src/optstr.c
diff options
context:
space:
mode:
authorKarel Zak2012-01-16 12:29:27 +0100
committerKarel Zak2012-01-16 12:29:27 +0100
commit07a67e6805aa92d98371ea6badaa2f879125358d (patch)
tree5775c90817d793fe1d749e5bb3e1a9d21ee5a782 /libmount/src/optstr.c
parentlibmount: add post-mount checks to detect ro/rw (diff)
downloadkernel-qcow2-util-linux-07a67e6805aa92d98371ea6badaa2f879125358d.tar.gz
kernel-qcow2-util-linux-07a67e6805aa92d98371ea6badaa2f879125358d.tar.xz
kernel-qcow2-util-linux-07a67e6805aa92d98371ea6badaa2f879125358d.zip
libmount: fix MS_BIND|MS_REC usage, improve some bitwise operations
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/optstr.c')
-rw-r--r--libmount/src/optstr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index 260dc26a8..9e98798af 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -700,7 +700,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags,
continue;
if (ent->id == MS_RDONLY ||
(ent->mask & MNT_INVERT) ||
- !(fl & ent->id)) {
+ (fl & ent->id) != ent->id) {
char *end = val ? val + valsz :
name + namesz;
@@ -722,7 +722,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags,
char *p;
for (ent = map; ent && ent->name; ent++) {
- if ((ent->mask & MNT_INVERT) || !(fl & ent->id))
+ if ((ent->mask & MNT_INVERT) || (fl & ent->id) != ent->id)
continue;
/* don't add options which require values (e.g. offset=%d) */