]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/mount/mount.c
behavior as file systems that use the monolithic /sbin/mount command.
[nfs-utils.git] / utils / mount / mount.c
index 6b9e1642c43fa1087dada7d38db47ee4126f5906..b4da21faa74508160ffde358ed96dd40074f3de6 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <unistd.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -208,7 +209,7 @@ static char *fix_opts_string(int flags, const char *extra_opts)
        }
        if (flags & MS_USERS)
                new_opts = xstrconcat3(new_opts, ",users", "");
-       
+
        for (om = opt_map; om->opt != NULL; om++) {
                if (om->skip)
                        continue;
@@ -280,7 +281,7 @@ static int add_mtab(char *spec, char *mount_point, char *fstype,
        ment.mnt_fsname = spec;
        ment.mnt_dir = mount_point;
        ment.mnt_type = fstype;
-       ment.mnt_opts = fix_opts_string(flags, opts);
+       ment.mnt_opts = fix_opts_string(flags & ~MS_NOMTAB, opts);
        ment.mnt_freq = freq;
        ment.mnt_passno = pass;
 
@@ -320,7 +321,7 @@ static int add_mtab(char *spec, char *mount_point, char *fstype,
        return result;
 }
 
-void mount_usage(void)
+static void mount_usage(void)
 {
        printf(_("usage: %s remotetarget dir [-rvVwfnsih] [-o nfsoptions]\n"),
                progname);
@@ -336,7 +337,7 @@ void mount_usage(void)
        printf(_("\tnfsoptions\tRefer to mount.nfs(8) or nfs(5)\n\n"));
 }
 
-static void parse_opt(const char *opt, int *mask, char *extra_opts, int len)
+static void parse_opt(const char *opt, int *mask, char *extra_opts, size_t len)
 {
        const struct opt_map *om;
 
@@ -370,7 +371,7 @@ static void parse_opts(const char *options, int *flags, char **extra_opts)
        if (options != NULL) {
                char *opts = xstrdup(options);
                char *opt, *p;
-               int len = strlen(opts) + 1;     /* include room for a null */
+               size_t len = strlen(opts) + 1;  /* include room for a null */
                int open_quote = 0;
 
                *extra_opts = xmalloc(len);