if (realpath(name, rname) == NULL) { warn("%s", rname);
if (realpath(oname, rname) == NULL) { warn("%s", oname);
umountfs(oname)	char *oname;{	enum clnt_stat clnt_stat;	struct hostent *hp;	struct sockaddr_in saddr;	struct stat sb;	struct timeval pertry, try;	CLIENT *clp;	int so;	char *delimp, *hostp, *mntpt;	char *name, *newname, rname[MAXPATHLEN], type[MFSNAMELEN];	if (realpath(name, rname) == NULL) {		warn("%s", rname);		return (1);	}	mntpt = name = rname;	newname = NULL;	if (stat(name, &sb) < 0) {		/*		 * 99.9% of the time the path in the kernel is the one		 * realpath() returns but check the original just in case...		 */		if (!(newname = getmntname(name, MNTFROM, type)) &&		    !(mntpt = getmntname(name, MNTON, type)) ) {			mntpt = oname;			if (!(newname = getmntname(oname, MNTFROM, type)) &&			    !(mntpt = getmntname(oname, MNTON, type))) {				warnx("%s: not currently mounted", oname);				return (1);			}		}		if (newname)			name = newname;	} else if (S_ISBLK(sb.st_mode)) {		if ((mntpt = getmntname(name, MNTON, type)) == NULL) {			warnx("%s: not currently mounted", name);			return (1);		}	} else if (S_ISDIR(sb.st_mode)) {		if ((name = getmntname(mntpt, MNTFROM, type)) == NULL) {			warnx("%s: not currently mounted", mntpt);			return (1);		}	} else {		warnx("%s: not a directory or special device", name);		return (1);	}	if (!selected(type))		return (1);	if (!strncmp(type, MOUNT_NFS, MFSNAMELEN)) {		if ((delimp = strchr(name, '@')) != NULL) {			hostp = delimp + 1;			*delimp = '\0';			hp = gethostbyname(hostp);			*delimp = '@';		} else if ((delimp = strchr(name, ':')) != NULL) {			*delimp = '\0';			hostp = name;			hp = gethostbyname(hostp);			name = delimp + 1;			*delimp = ':';		} else			hp = NULL;		if (!namematch(hp))			return (1);	}	if (verbose)		(void)printf("%s: unmount from %s\n", name, mntpt);	if (fake)		return (0);	if (unmount(mntpt, fflag) < 0) {		warn("%s", mntpt);		return (1);	}	if (!strncmp(type, MOUNT_NFS, MFSNAMELEN) &&	    (hp != NULL) && !(fflag & MNT_FORCE)) {		*delimp = '\0';		memset(&saddr, 0, sizeof(saddr));		saddr.sin_family = AF_INET;		saddr.sin_port = 0;		memmove(&saddr.sin_addr, hp->h_addr, hp->h_length);		pertry.tv_sec = 3;		pertry.tv_usec = 0;		so = RPC_ANYSOCK;		if ((clp = clntudp_create(&saddr,		    RPCPROG_MNT, RPCMNT_VER1, pertry, &so)) == NULL) {			clnt_pcreateerror("Cannot MNT PRC");			return (1);		}		clp->cl_auth = authunix_create_default();		try.tv_sec = 20;		try.tv_usec = 0;		clnt_stat = clnt_call(clp,		    RPCMNT_UMOUNT, xdr_dir, name, xdr_void, (caddr_t)0, try);		if (clnt_stat != RPC_SUCCESS) {			clnt_perror(clp, "Bad MNT RPC");			return (1);		}		auth_destroy(clp->cl_auth);		clnt_destroy(clp);	}	return (0);}