aboutsummaryrefslogtreecommitdiffstats
path: root/libmount/src
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2025-04-24 18:45:24 +0200
committerKarel Zak <kzak@redhat.com>2025-04-24 18:45:24 +0200
commit78ade43875b09436616421a6dd10d53673fde415 (patch)
treeebceba5eb6d600798a86bf57723081aa88a63e21 /libmount/src
parent9e96e6ed9cce4cbaf3b9ca6e61d0b0ee070685e9 (diff)
downloadutil-linux-78ade43875b09436616421a6dd10d53673fde415.tar.gz
libmount: use and add has_listmount()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src')
-rw-r--r--libmount/src/tab_listmount.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libmount/src/tab_listmount.c b/libmount/src/tab_listmount.c
index c9725a23c5..e4a1c2a529 100644
--- a/libmount/src/tab_listmount.c
+++ b/libmount/src/tab_listmount.c
@@ -91,18 +91,13 @@ static int table_init_listmount(struct libmnt_table *tb, size_t stepsiz)
ls = tb->lsmnt;
/* check if supported by current kernel */
- if (!ls) {
- uint64_t dummy;
-
- errno = 0;
- if (ul_listmount(LSMT_ROOT, 0, 0, &dummy, 1, LISTMOUNT_REVERSE) != 1) {
- if (errno == ENOSYS)
- DBG(TAB, ul_debugobj(tb, "listmount: unsuppported"));
- if (errno == EINVAL)
- DBG(TAB, ul_debugobj(tb, "listmount: reverse unsuppported"));
- errno = ENOSYS;
- return -ENOSYS;
- }
+ if (!ls && !has_listmount()) {
+ if (errno == ENOSYS)
+ DBG(TAB, ul_debugobj(tb, "listmount: unsuppported"));
+ if (errno == EINVAL)
+ DBG(TAB, ul_debugobj(tb, "listmount: reverse unsuppported"));
+ errno = ENOSYS;
+ return -ENOSYS;
}
/* reset if allocated for a different size */