libmount: mark entries from /proc/swaps by MNT_FS_SWAP

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>
This commit is contained in:
Karel Zak 2021-01-08 12:00:59 +01:00
parent e7091237db
commit f19295ad12
1 changed files with 3 additions and 1 deletions

View 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 {