X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmount%2Fmount.c;h=a668cd97c673f0aff792aaec3e5e99e415eec8d7;hb=b46dc42505da799a05a3a5e8f004b308f6b9eef7;hp=a7539324122c68b1281ac9b127a9ed3b5add0a90;hpb=58080798db321d025143df39c97f707ea994ba26;p=nfs-utils.git diff --git a/utils/mount/mount.c b/utils/mount/mount.c index a753932..a668cd9 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -45,8 +44,8 @@ #include "nfs4_mount.h" #include "mount.h" #include "error.h" -#include "network.h" #include "stropts.h" +#include "version.h" char *progname; int nfs_mount_data_version; @@ -146,24 +145,8 @@ static const struct opt_map opt_map[] = { { NULL, 0, 0, 0 } }; -#define MAKE_VERSION(p,q,r) (65536 * (p) + 256 * (q) + (r)) - static void parse_opts(const char *options, int *flags, char **extra_opts); -int linux_version_code(void) -{ - struct utsname my_utsname; - int p, q, r; - - if (uname(&my_utsname) == 0) { - p = atoi(strtok(my_utsname.release, ".")); - q = atoi(strtok(NULL, ".")); - r = atoi(strtok(NULL, ".")); - return MAKE_VERSION(p,q,r); - } - return 0; -} - /* * Choose the version of the nfs_mount_data structure that is appropriate * for the kernel that is doing the mount. @@ -173,7 +156,7 @@ int linux_version_code(void) */ static void discover_nfs_mount_data_version(void) { - int kernel_version = linux_version_code(); + unsigned int kernel_version = linux_version_code(); if (kernel_version) { if (kernel_version < MAKE_VERSION(2, 1, 32)) @@ -434,7 +417,7 @@ static int chk_mountpoint(char *mount_point) 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; @@ -599,7 +582,7 @@ int main(int argc, char *argv[]) } 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); @@ -617,7 +600,7 @@ int main(int argc, char *argv[]) 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);