#endif
#include "pathnames.h"
+#include "strutils.h"
#include "ismounted.h"
#include "c.h"
#ifdef __linux__
/* maybe the file is loopdev backing file */
if (file_dev
&& major(st_buf.st_rdev) == LOOPDEV_MAJOR
- && loopdev_is_used(mnt->mnt_fsname, file, 0, 0))
+ && loopdev_is_used(mnt->mnt_fsname, file, 0, 0, 0))
break;
#endif /* __linux__ */
#endif /* __GNU__ */
st_buf.st_dev == file_rdev) {
*mount_flags = MF_MOUNTED;
if (mtpt)
- strncpy(mtpt, "/", mtlen);
+ xstrncpy(mtpt, "/", mtlen);
goto is_root;
}
#endif /* __GNU__ */
#endif
if (mtpt)
- strncpy(mtpt, mnt->mnt_dir, mtlen);
+ xstrncpy(mtpt, mnt->mnt_dir, mtlen);
/*
* Check to see if we're referring to the root filesystem.
* If so, do a manual check to see if we can open /etc/mtab
++mp;
}
if (mtpt)
- strncpy(mtpt, mp->f_mntonname, mtlen);
+ xstrncpy(mtpt, mp->f_mntonname, mtlen);
return 0;
}
#endif /* HAVE_GETMNTINFO */
if (is_swap_device(device)) {
*mount_flags = MF_MOUNTED | MF_SWAP;
if (mtpt && mtlen)
- strncpy(mtpt, "[SWAP]", mtlen);
+ xstrncpy(mtpt, "[SWAP]", mtlen);
} else {
#ifdef HAVE_MNTENT_H
retval = check_mntent(device, mount_flags, mtpt, mtlen);
return mount_flags & MF_MOUNTED;
}
-#ifdef TEST_PROGRAM
+#ifdef TEST_PROGRAM_ISMOUNTED
int main(int argc, char **argv)
{
int flags = 0;