/* TODO: walk up the directory tree so it works on on paths that are not actually mount points. */
+ struct mntent *me;
FILE *mtab = setmntent("/etc/mtab", "r");
if (mtab == NULL) {
return;
}
- struct mntent *me = getmntent(mtab);
+ me = getmntent(mtab);
// find our path in the mtab
while (strcmp(path, me->mnt_dir) && getmntent(mtab));