summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libmount/src/context_mount.c3
-rw-r--r--libmount/src/utils.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c
index f3d8ff10..fdb459c3 100644
--- a/libmount/src/context_mount.c
+++ b/libmount/src/context_mount.c
@@ -587,6 +587,9 @@ static int do_mount_by_pattern(struct libmnt_context *cxt, const char *pattern)
if (rc)
return rc;
+ if (filesystems == NULL)
+ return -MNT_ERR_NOFSTYPE;
+
for (fp = filesystems; *fp; fp++) {
rc = do_mount(cxt, *fp);
if (mnt_context_get_status(cxt))
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index 245a3b25..0cfefb34 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -473,6 +473,10 @@ static int get_filesystems(const char *filename, char ***filesystems, const char
return rc;
}
+/*
+ * Returns zero also if not found any matching filesystem. Always check
+ * @filesystems pointer!
+ */
int mnt_get_filesystems(char ***filesystems, const char *pattern)
{
int rc;