diff options
Diffstat (limited to 'src/shared/fstab-util.c')
-rw-r--r-- | src/shared/fstab-util.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c index b0e274afcc..6efdcd6896 100644 --- a/src/shared/fstab-util.c +++ b/src/shared/fstab-util.c @@ -20,6 +20,8 @@ int fstab_has_fstype(const char *fstype) { _cleanup_endmntent_ FILE *f = NULL; struct mntent *m; + assert(fstype); + f = setmntent(fstab_path(), "re"); if (!f) return errno == ENOENT ? false : -errno; @@ -288,3 +290,14 @@ char *fstab_node_to_udev_node(const char *p) { return strdup(p); } + +bool fstab_is_bind(const char *options, const char *fstype) { + + if (fstab_test_option(options, "bind\0" "rbind\0")) + return true; + + if (fstype && STR_IN_SET(fstype, "bind", "rbind")) + return true; + + return false; +} |