errno = EACCES;
else if (rpc_createerr.cf_stat == RPC_TIMEDOUT)
errno = ETIMEDOUT;
+ else if (rpc_createerr.cf_stat == RPC_PROGVERSMISMATCH)
+ errno = EPROTONOSUPPORT;
else if (rpc_createerr.cf_error.re_errno != 0)
errno = rpc_createerr.cf_error.re_errno;
return 0;
case ECONNREFUSED:
case EOPNOTSUPP:
case EHOSTUNREACH:
+ case ETIMEDOUT:
+ case EACCES:
continue;
default:
goto out;
{
struct mount_options *options = po_dup(mi->options);
int result = 0;
+ char *extra_opts = NULL;
if (!options) {
errno = ENOMEM;
goto out_fail;
}
- /*
- * Update option string to be recorded in /etc/mtab.
- */
- if (po_join(options, mi->extra_opts) == PO_FAILED) {
+ if (po_join(options, &extra_opts) == PO_FAILED) {
errno = ENOMEM;
goto out_fail;
}
if (verbose)
printf(_("%s: trying text-based options '%s'\n"),
- progname, *mi->extra_opts);
+ progname, extra_opts);
result = nfs_sys_mount(mi, options);
+ /*
+ * If success, update option string to be recorded in /etc/mtab.
+ */
+ if (result) {
+ free(*mi->extra_opts);
+ *mi->extra_opts = extra_opts;
+ } else
+ free(extra_opts);
+
out_fail:
po_destroy(options);
return result;
switch (errno) {
case ECONNREFUSED:
case EHOSTUNREACH:
+ case ETIMEDOUT:
+ case EACCES:
continue;
default:
goto out;