X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnetwork.c;h=f020933dfe87d6ed1d55e6e04b401943d5d768a2;hp=a12fbe23ef9f779f29fc03f30abf2fc48be40332;hb=33203b53ac5f43eef995c100299e45bd441c67d8;hpb=1d4a0cb29ee88257b42d18a22388e1b23cf13bcc diff --git a/utils/mount/network.c b/utils/mount/network.c index a12fbe2..f020933 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -1273,7 +1273,8 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version) /* * Returns TRUE if @protocol contains a valid value for this option, - * or FALSE if the option was specified with an invalid value. + * or FALSE if the option was specified with an invalid value. On + * error, errno is set. */ int nfs_nfs_protocol(struct mount_options *options, unsigned long *protocol) @@ -1290,8 +1291,13 @@ nfs_nfs_protocol(struct mount_options *options, unsigned long *protocol) return 1; case 2: /* proto */ option = po_get(options, "proto"); - if (option != NULL) - return nfs_get_proto(option, &family, protocol); + if (option != NULL) { + if (!nfs_get_proto(option, &family, protocol)) { + errno = EPROTONOSUPPORT; + return 0; + } + return 1; + } } /* @@ -1449,7 +1455,8 @@ nfs_mount_version(struct mount_options *options, unsigned long *version) /* * Returns TRUE if @protocol contains a valid value for this option, - * or FALSE if the option was specified with an invalid value. + * or FALSE if the option was specified with an invalid value. On + * error, errno is set. */ static int nfs_mount_protocol(struct mount_options *options, unsigned long *protocol) @@ -1458,8 +1465,13 @@ nfs_mount_protocol(struct mount_options *options, unsigned long *protocol) char *option; option = po_get(options, "mountproto"); - if (option != NULL) - return nfs_get_proto(option, &family, protocol); + if (option != NULL) { + if (!nfs_get_proto(option, &family, protocol)) { + errno = EPROTONOSUPPORT; + return 0; + } + return 1; + } /* * MNT transport protocol wasn't specified. If the NFS