diff options
Diffstat (limited to 'shlibs/mount/src/utils.c')
-rw-r--r-- | shlibs/mount/src/utils.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shlibs/mount/src/utils.c b/shlibs/mount/src/utils.c index a1ab50c08..9bdd62ade 100644 --- a/shlibs/mount/src/utils.c +++ b/shlibs/mount/src/utils.c @@ -28,6 +28,7 @@ #include <fcntl.h> #include <pwd.h> +#include "pathnames.h" #include "mountP.h" char *mnt_getenv_safe(const char *arg) @@ -249,6 +250,18 @@ char *mnt_get_username(const uid_t uid) return username; } +/* + * Returns 1 if /etc/mtab is a reqular file. + */ +int mnt_has_regular_mtab(void) +{ + struct stat st; + + if (lstat(_PATH_MOUNTED, &st) == 0 && S_ISREG(st.st_mode)) + return 1; + return 0; +} + #ifdef TEST_PROGRAM int test_match_fstype(struct mtest *ts, int argc, char *argv[]) { |