umount.c revision 4bff34e37def8a90f9194d81bc345c52ba20086a
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * CDDL HEADER START
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * The contents of this file are subject to the terms of the
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Common Development and Distribution License (the "License").
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * You may not use this file except in compliance with the License.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * See the License for the specific language governing permissions
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * and limitations under the License.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * When distributing Covered Code, include this CDDL HEADER in each
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * If applicable, add the following below this CDDL HEADER, with the
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * fields enclosed by brackets "[]" replaced with your own identifying
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * information: Portions Copyright [yyyy] [name of copyright owner]
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * CDDL HEADER END
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Use is subject to license terms.
4bff34e37def8a90f9194d81bc345c52ba20086athurlow#pragma ident "%Z%%M% %I% %E% SMI"
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * smbfs umount
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic void usage();
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic int smbfs_unmount(char *, int);
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic char *myname;
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Set options
4bff34e37def8a90f9194d81bc345c52ba20086athurlow switch (c) {
4bff34e37def8a90f9194d81bc345c52ba20086athurlow umnt_flag |= MS_FORCE; /* forced unmount is desired */
4bff34e37def8a90f9194d81bc345c52ba20086athurlow gettext("Usage: smbfs umount [-o opts] {//server/share | dir}\n"));
4bff34e37def8a90f9194d81bc345c52ba20086athurlow pr_err(gettext("%s: %s\n"), pathname, strerror(errno));
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Find the mnttab entry that corresponds to "name".
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * We're not sure what the name represents: either
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * a mountpoint name, or a special name (server:/path).
4bff34e37def8a90f9194d81bc345c52ba20086athurlow * Return the last entry in the file that matches.
4bff34e37def8a90f9194d81bc345c52ba20086athurlowstatic struct extmnttab *
4bff34e37def8a90f9194d81bc345c52ba20086athurlow while (getextmntent(fp, &mnt, sizeof (struct extmnttab)) == 0) {