* %End-Header%
*/
+#include "config.h"
#include <stdio.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#include "et/com_err.h"
+#ifdef HAVE_SETMNTENT
static char *skip_over_blank(char *cp)
{
while (*cp && isspace(*cp))
*buf = next;
return word;
}
+#endif
/*
* Helper function which checks a file in /etc/mtab format to see if a
static errcode_t check_mntent_file(const char *mtab_file, const char *file,
int *mount_flags)
{
-#ifdef HAVE_MNTENT_H
+#ifdef HAVE_SETMNTENT
struct stat st_buf;
errcode_t retval = 0;
dev_t file_dev=0, file_rdev=0;
char buf[1024], *device = 0, *mnt_dir = 0, *cp;
*mount_flags = 0;
- if ((f = fopen(mtab_file, "r")) == NULL)
- return errno;
-
if ((f = setmntent (mtab_file, "r")) == NULL)
return errno;
if (stat(file, &st_buf) == 0) {
errout:
endmntent (f);
return retval;
-#else /* !HAVE_MNTENT_H */
+#else /* !HAVE_SETMNTENT */
return 0;
#endif /* HAVE_MNTENT_H */
}