2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Just in case we're not in a build environment, make sure that 2N/A * TEXT_DOMAIN gets set to something. 2N/A * patch filesystem lines into vfstab file, return tempfilename 2N/A /* "swap" if updating swap partition */ 2N/A /* for deciding which of multiple */ 2N/A /* swap file entries to change */ 2N/A /* if NULL then not changing swap */ 2N/A char **
tname,
/* returned temp file name */ 2N/A /* or fstype if swap */ 2N/A /* get temp names */ 2N/A /* check if going to update swap entry in file */ 2N/A /* if so then compare against file system type */ 2N/A /* copy vfstab file, replace filesystem line */ 2N/A /* check that have all required params from vfstab file */ 2N/A /* or that the line isnt a comment */ 2N/A /* or that the block device matches if changing swap */ 2N/A /* the last check is needed since there may be multiple */ 2N/A /* entries of swap in the file, and so the fstype is not */ 2N/A /* a sufficient check */ 2N/A if ((
sscanf(
buf,
"%512s %512s %512s %512s %512s %512s %512s",
2N/A "Delete the following line from %s:\n\n"),
2N/A "Add the following line to %s:\n\n"),
2N/A (
void)
printf(
"%s\t%s\t%s\t%s\t%s\t%s\t%s\n\n",
2N/A /* return success */ 2N/A /* cleanup, return error */ 2N/A * set filesystem device name in vfstab 2N/A /* replace lines in vfstab */ 2N/A /* rename temp file on top of real one */ 2N/A /* cleanup, return error */ 2N/A * set filesystem device name in vfstab 2N/A /* replace lines in vfstab */ 2N/A /* rename temp file on top of real one */ 2N/A /* cleanup, return error */