FreeBSD/usr.sbin/jail/state.c
/*
 * Resolve any dependencies from a finished jail.
 */
Resolve any dependencies from a finished jail.
Resolve any dependencies from a finished jail .
void
dep_done(struct cfjail *j, unsigned flags)
{
	struct cfjail *dj;
	struct cfdepend *d;
	int depfrom, depto;
	if (JF_DO_STOP(j->flags)) {
		depfrom = DEP_TO;
		depto = DEP_FROM;
	} else {
		depfrom = DEP_FROM;
		depto = DEP_TO;
	}
	STAILQ_FOREACH(d, &j->dep[depto], tq[depto]) {
		if ((d->flags & DF_SEEN) | (flags & ~d->flags & DF_LIGHT))
			continue;
		d->flags |= DF_SEEN;
		dj = d->j[depfrom];
		if (!(flags & DF_NOFAIL) && (j->flags & JF_FAILED) &&
		    (j->flags & (JF_OP_MASK | JF_DEPEND)) !=
		    (JF_SET | JF_DEPEND)) {
			if (!(dj->flags & (JF_DEPEND | JF_FAILED)) &&
			    verbose >= 0)
				jail_warnx(dj, "skipped");
			dj->flags |= JF_FAILED;
		}
		if (!--dj->ndeps && dj->queue == &depend)
			requeue(dj, &ready);
	}
}
void dep_done ( struct cfjail * j , unsigned flags ) { struct cfjail * dj ; struct cfdepend * d ; int depfrom , depto ; if ( JF_DO_STOP ( j -> flags ) ) { depfrom = DEP_TO ; depto = DEP_FROM ; } else { depfrom = DEP_FROM ; depto = DEP_TO ; } STAILQ_FOREACH ( d , & j -> dep [ depto ] , tq [ depto ] ) { if ( ( d -> flags & DF_SEEN ) | ( flags & ~ d -> flags & DF_LIGHT ) ) continue ; d -> flags |= DF_SEEN ; dj = d -> j [ depfrom ] ; if ( ! ( flags & DF_NOFAIL ) && ( j -> flags & JF_FAILED ) && ( j -> flags & ( JF_OP_MASK | JF_DEPEND ) ) != ( JF_SET | JF_DEPEND ) ) { if ( ! ( dj -> flags & ( JF_DEPEND | JF_FAILED ) ) && verbose >= 0 ) jail_warnx ( dj , " " ) ; dj -> flags |= JF_FAILED ; } if ( ! -- dj -> ndeps && dj -> queue == & depend ) requeue ( dj , & ready ) ; } }
Resolve any dependencies from a finished jail.
Resolve any dependencies from a finished jail .