X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fmount%2Fstropts.c;h=f73521f2c7812e199b6c6ab37b26d1aa1b9bad47;hb=6e54f6179cb9e9d5706901a06744b8f4667c24e7;hp=12f64230abbe3c1905206db2f7627c44bf15dcf5;hpb=be77debb799a97bab5c7ecf9f1082f967a692eef;p=nfs-utils.git diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index 12f6423..f73521f 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -201,7 +201,9 @@ static int append_addr_opt(struct sockaddr_in *saddr, char **extra_opts) } /* - * Append the 'clientaddr=' option to the options string. + * Called if no 'clientaddr=' option was specified in the options string + * to discover our address and append an appropriate 'clientaddr=' option + * to the options string. * * Returns 1 if 'clientaddr=' option created successfully; * otherwise zero. @@ -241,12 +243,12 @@ static int append_clientaddr_opt(struct sockaddr_in *saddr, char **extra_opts) * @extra_opts: pointer to C string containing fs-specific mount options * (possibly also a return argument) * @fake: flag indicating whether to carry out the whole operation - * @bg: one if this is a backgrounded mount attempt + * @child: one if this is a backgrounded mount * * XXX: need to handle bg, fg, and retry options. */ int nfsmount_s(const char *spec, const char *node, int flags, - char **extra_opts, int fake, int bg) + char **extra_opts, int fake, int child) { struct sockaddr_in saddr; char *hostname; @@ -261,7 +263,7 @@ int nfsmount_s(const char *spec, const char *node, int flags, extract_interesting_options(*extra_opts); - if (!bg && addr_opt) { + if (!child && addr_opt) { nfs_error(_("%s: Illegal option: 'addr='"), progname); return EX_FAIL; } @@ -281,7 +283,7 @@ int nfsmount_s(const char *spec, const char *node, int flags, } } - return 0; + return EX_SUCCESS; } /* @@ -319,15 +321,10 @@ int nfs4mount_s(const char *spec, const char *node, int flags, return EX_FAIL; } - if (ca_opt) { - nfs_error(_("%s: Illegal option: 'clientaddr='"), progname); - return EX_FAIL; - } - if (!append_addr_opt(&saddr, extra_opts)) return EX_FAIL; - if (!append_clientaddr_opt(&saddr, extra_opts)) + if (!ca_opt && !append_clientaddr_opt(&saddr, extra_opts)) return EX_FAIL; if (verbose) @@ -342,5 +339,5 @@ int nfs4mount_s(const char *spec, const char *node, int flags, } } - return 0; + return EX_SUCCESS; }