]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: mark entries from /proc/swaps by MNT_FS_SWAP
authorKarel Zak <kzak@redhat.com>
Fri, 8 Jan 2021 11:00:59 +0000 (12:00 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 8 Jan 2021 11:00:59 +0000 (12:00 +0100)
The function mnt_fs_is_swaparea() does not return TRUE for entries
from /proc/swaps. This is pretty strange.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_parse.c

index ac12dce54a4fd9a5cd56959ce17ef6afaed2619e..95585b5b785cf3ddc0cbb5d6ddda4b9f60560971 100644 (file)
@@ -723,7 +723,9 @@ int mnt_table_parse_stream(struct libmnt_table *tb, FILE *f, const char *filenam
        /* necessary for /proc/mounts only, the /proc/self/mountinfo
         * parser sets the flag properly
         */
-       if (filename && strcmp(filename, _PATH_PROC_MOUNTS) == 0)
+       if (tb->fmt == MNT_FMT_SWAPS)
+               flags = MNT_FS_SWAP;
+       else if (filename && strcmp(filename, _PATH_PROC_MOUNTS) == 0)
                flags = MNT_FS_KERNEL;
 
        do {