]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: map unsupported LISTMOUNT_REVERSE to ENOSYS
authorKarel Zak <kzak@redhat.com>
Wed, 8 Jan 2025 09:51:02 +0000 (10:51 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 8 Jan 2025 12:57:43 +0000 (13:57 +0100)
For testing purposes, report the missing LISTMOUNT_REVERSE as missing
in the complete listmount() function.

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/tab_listmount.c
tests/helpers/test_sysinfo.c

index a9116da8a16e79999e8862dae226af81dd29f780..e55786f27812b7730ab7a7f6e14f70ee764c0cc6 100644 (file)
@@ -100,6 +100,7 @@ static int table_init_listmount(struct libmnt_table *tb, size_t stepsiz)
                                DBG(TAB, ul_debugobj(tb, "listmount: unsuppported"));
                        if (errno == EINVAL)
                                DBG(TAB, ul_debugobj(tb, "listmount: reverse unsuppported"));
+                       errno = ENOSYS;
                        return -ENOSYS;
                }
        }
index f23f9111ab53850e95aa7061f4579f3e75a7367a..7cda1178f9351a7e83617b71a0db41c9876c90c2 100644 (file)
@@ -163,7 +163,7 @@ static int hlp_listmount_ok(void)
 #else
        errno = ENOSYS;
 #endif
-       printf("%d\n", errno != ENOSYS);
+       printf("%d\n", !(errno == ENOSYS || errno == EINVAL));
        return 0;
 }