]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (mount) remove last mountflags use
authorKarel Zak <kzak@redhat.com>
Tue, 23 Aug 2022 11:08:52 +0000 (13:08 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c

index e8e4cab7f5db4049cc72ad7638e564ebee5e0372..a679a8029630f7dd0550be6c248e35b6c2a34d3b 100644 (file)
@@ -555,6 +555,7 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
 {
        int rc = 0;
        char *org_type = NULL;
+       struct libmnt_optlist *ol = NULL;
 
        assert(cxt);
        assert(cxt->fs);
@@ -577,7 +578,10 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
        }
 
        if (try_type) {
-               cxt->mountflags |= MS_SILENT;
+               ol = mnt_context_get_optlist(cxt);
+               assert(ol);
+
+               mnt_optlist_append_flags(ol, MS_SILENT, cxt->map_linux);
                if (mnt_fs_get_fstype(cxt->fs)) {
                        org_type = strdup(mnt_fs_get_fstype(cxt->fs));
                        if (!org_type) {
@@ -606,8 +610,8 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type)
        }
 
 done:
-       if (try_type)
-               cxt->mountflags &= ~MS_SILENT;
+       if (try_type && ol)
+               mnt_optlist_remove_flags(ol, MS_SILENT, cxt->map_linux);
        free(org_type);
        return rc;
 }