summaryrefslogtreecommitdiff
path: root/mtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'mtab.c')
-rw-r--r--mtab.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mtab.c b/mtab.c
index 64e7250..9cd50d8 100644
--- a/mtab.c
+++ b/mtab.c
@@ -77,6 +77,22 @@ mono_time(void) {
return ret;
}
+/*
+ * See if mtab is present and whether it's a symlink. Returns errno from stat()
+ * call or EMLINK if it's a symlink.
+ */
+int
+mtab_unusable(void)
+{
+ struct stat mstat;
+
+ if(lstat(_PATH_MOUNTED, &mstat))
+ return errno;
+ else if (S_ISLNK(mstat.st_mode))
+ return EMLINK;
+ return 0;
+}
+
/* Remove lock file. */
void
unlock_mtab (void) {