#include <unistd.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "xcommon.h"
#include "nls.h"
#include "mount_constants.h"
+#include "mount_config.h"
#include "nfs_paths.h"
#include "nfs_mntent.h"
static int try_mount(char *spec, char *mount_point, int flags,
char *fs_type, char **extra_opts, char *mount_opts,
- int fake, int nomtab, int bg)
+ int fake, int bg)
{
int ret;
spec = argv[1];
mount_point = argv[2];
+ mount_config_init(progname);
+
argv[2] = argv[0]; /* so that getopt error messages are correct */
while ((c = getopt_long(argc - 2, argv + 2, "rvVwfno:hs",
longopts, NULL)) != -1) {
mnt_err = EX_USAGE;
goto out;
}
+ /*
+ * Concatenate mount options from the configuration file
+ */
+ mount_opts = mount_config_opts(spec, mount_point, mount_opts);
parse_opts(mount_opts, &flags, &extra_opts);
}
mnt_err = try_mount(spec, mount_point, flags, fs_type, &extra_opts,
- mount_opts, fake, nomtab, FOREGROUND);
+ mount_opts, fake, FOREGROUND);
if (mnt_err == EX_BG) {
printf(_("%s: backgrounding \"%s\"\n"),
progname, spec);
+ printf(_("%s: mount options: \"%s\"\n"),
+ progname, extra_opts);
+
fflush(stdout);
/*
mnt_err = try_mount(spec, mount_point, flags, fs_type,
&extra_opts, mount_opts, fake,
- nomtab, BACKGROUND);
+ BACKGROUND);
if (verbose && mnt_err)
printf(_("%s: giving up \"%s\"\n"),
progname, spec);