*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 021110-1307, USA.
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 0211-1301 USA
*
*/
if (po_append(options, new_option) == PO_FAILED)
return 0;
- po_remove_all(options, "port");
- if (nfs_pmap->pm_port != NFS_PORT) {
+ if(po_remove_all(options, "port") == PO_FOUND ||
+ nfs_pmap->pm_port != NFS_PORT) {
snprintf(new_option, sizeof(new_option) - 1,
"port=%lu", nfs_pmap->pm_port);
if (po_append(options, new_option) == PO_FAILED)
errno = EOPNOTSUPP;
else if (rpc_createerr.cf_stat == RPC_AUTHERROR)
errno = EACCES;
+ else if (rpc_createerr.cf_stat == RPC_TIMEDOUT)
+ errno = ETIMEDOUT;
else if (rpc_createerr.cf_error.re_errno != 0)
errno = rpc_createerr.cf_error.re_errno;
return 0;
case EHOSTUNREACH:
continue;
default:
- break;
+ goto out;
}
}
+out:
return ret;
}
case EHOSTUNREACH:
continue;
default:
- break;
+ goto out;
}
}
+out:
return ret;
}
if (nfs_try_mount(mi))
return EX_SUCCESS;
- if (nfs_is_permanent_error(errno)) {
+ /* retry background mounts when the server is not up */
+ if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) {
mount_error(mi->spec, mi->node, errno);
return EX_FAIL;
}
if (nfs_try_mount(mi))
return EX_SUCCESS;
- if (nfs_is_permanent_error(errno))
+ /* retry background mounts when the server is not up */
+ if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP)
break;
if (time(NULL) > timeout)