Export ismnt() and fismnt() helper functions, for modprobe plugin

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2020-04-26 14:55:38 +02:00
1 parent 37d92e87bc
commit 3f5ff0d339
3 files changed
+32 -27

No files matched your search

-27
View File
@@ -84,33 +84,6 @@ static void banner(void)
print_banner(INIT_HEADING);
}
static int ismnt(char *file, char *dir)
{
FILE *fp;
int found = 0;
struct mntent *mnt;
fp = setmntent(file, "r");
if (!fp)
return 0; /* Dunno, maybe not */
while ((mnt = getmntent(fp))) {
if (!strcmp(mnt->mnt_dir, dir)) {
found = 1;
break;
}
}
endmntent(fp);
return found;
}
/* Requires /proc to be mounted */
static int fismnt(char *dir)
{
return ismnt("/proc/mounts", dir);
}
/*
* Check all filesystems in /etc/fstab with a fs_passno > 0
*/