eptstat.c revision 5c51f1241dbbdf2656d0e10011981411ed0c9673
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * CDDL HEADER START
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * The contents of this file are subject to the terms of the
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * Common Development and Distribution License (the "License").
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * You may not use this file except in compliance with the License.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * or http://www.opensolaris.org/os/licensing.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * See the License for the specific language governing permissions
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * and limitations under the License.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * When distributing Covered Code, include this CDDL HEADER in each
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * If applicable, add the following below this CDDL HEADER, with the
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * fields enclosed by brackets "[]" replaced with your own identifying
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * information: Portions Copyright [yyyy] [name of copyright owner]
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * CDDL HEADER END
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * Use is subject to license terms.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland/* All Rights Reserved */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland#define ERR_MEMORY "memory allocation failure, errno=%d"
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland/* Free all allocated package info structures. */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * This function manipulates the pinfo entry corresponding to the package
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * indicated on the command line.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterlandeptstat(struct cfent *entry, char *pkg, char c)
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland struct pinfo *pinfo, *last, *me, *myparent;
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland pinfo_handle = bl_create(PINFOALLOC, sizeof (struct pinfo),
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland "package data");
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland for (pinfo = entry->pinfo; pinfo; pinfo = pinfo->next) {
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * use a delete/add strategy to keep package list
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * ordered by modification time
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* remove from list first */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* leave 'me' around until later! */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland if ((c != STAT_NEXT) && (me || (c != RM_RDY))) {
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* need to add onto end */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* LINTED pointer cast may result in impro... */
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * Only change status for local objects. Need
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * to maintain "shared" status for objects that
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland * are provided from a server.
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland me->status = ((c == DUP_ENTRY) ? '\0' : c);
5c51f1241dbbdf2656d0e10011981411ed0c9673Moriah Waterland /* just wanted to remove this package from list */