- pmap->pm_prog = MOUNTPROG;
- pmap->pm_vers = MOUNTVERS_NFSV3;
- pmap->pm_prot = IPPROTO_TCP;
- if (opts && (p = strstr(opts, "mountprog=")) && isdigit(*(p+10)))
- pmap->pm_prog = atoi(p+10);
- if (opts && (p = strstr(opts, "mountport=")) && isdigit(*(p+10)))
- pmap->pm_port = atoi(p+10);
- if (opts && hasmntopt(&mnt, "v2"))
- pmap->pm_vers = nfsvers_to_mnt(2);
- if (opts && hasmntopt(&mnt, "v3"))
- pmap->pm_vers = nfsvers_to_mnt(3);
- if (opts && hasmntopt(&mnt, "v4"))
- pmap->pm_vers = nfsvers_to_mnt(4);
- if (opts && (p = strstr(opts, "vers=")) && isdigit(*(p+5)))
- pmap->pm_vers = nfsvers_to_mnt(atoi(p+5));
- if (opts && (p = strstr(opts, "mountvers=")) && isdigit(*(p+10)))
- pmap->pm_vers = atoi(p+10);
- if (opts && (hasmntopt(&mnt, "udp") || hasmntopt(&mnt, "proto=udp")))
- pmap->pm_prot = IPPROTO_UDP;
-
- if (!nfs_gethostbyname(hostname, &mnt_server.saddr))
- goto out_bad;
- return nfs_call_umount(&mnt_server, &dirname);
- out_bad:
- nfs_error(_("%s: %s: not found or not mounted"), progname, spec);
- return 0;