diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-07-15 12:10:33 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2008-07-15 12:10:33 -0400 |
commit | d5a09b59916d4ef24b15e34eac394149cb7a641a (patch) | |
tree | 72f510411b8a8d51d7d98b661d8f688fd078e279 /utils/mount/mount.c | |
parent | 4f101548ef4990979400b7095e199c30204b100a (diff) | |
download | nfs-utils-d5a09b59916d4ef24b15e34eac394149cb7a641a.tar.gz nfs-utils-d5a09b59916d4ef24b15e34eac394149cb7a641a.tar.xz nfs-utils-d5a09b59916d4ef24b15e34eac394149cb7a641a.zip |
Moved the kernel version-ing code into a new version.h
header file which allows the code to be shared
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/mount.c')
-rw-r--r-- | utils/mount/mount.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/utils/mount/mount.c b/utils/mount/mount.c index a753932..d0eb1a0 100644 --- a/utils/mount/mount.c +++ b/utils/mount/mount.c @@ -29,7 +29,6 @@ #include <errno.h> #include <fcntl.h> #include <sys/mount.h> -#include <sys/utsname.h> #include <getopt.h> #include <mntent.h> #include <pwd.h> @@ -47,6 +46,7 @@ #include "error.h" #include "network.h" #include "stropts.h" +#include "version.h" char *progname; int nfs_mount_data_version; @@ -146,24 +146,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. |