xnu-4903.241.1/bsd/security/audit/audit_pipe.c
/*
 * Flush all records currently present in an audit pipe; assume mutex is held.
 */
Flush all records currently present in an audit pipe; assume mutex is held.
Flush all records currently present in an audit pipe ; assume mutex is held .
static void
audit_pipe_flush(struct audit_pipe *ap)
{
	struct audit_pipe_entry *ape;
	AUDIT_PIPE_LOCK_ASSERT(ap);
	while ((ape = TAILQ_FIRST(&ap->ap_queue)) != NULL) {
		TAILQ_REMOVE(&ap->ap_queue, ape, ape_queue);
		ap->ap_qbyteslen -= ape->ape_record_len;
		audit_pipe_entry_free(ape);
		ap->ap_qlen--;
	}
	ap->ap_qoffset = 0;
	KASSERT(ap->ap_qlen == 0, ("audit_pipe_free: ap_qbyteslen"));
	KASSERT(ap->ap_qbyteslen == 0, ("audit_pipe_flush: ap_qbyteslen"));
}
static void audit_pipe_flush ( struct audit_pipe * ap ) { struct audit_pipe_entry * ape ; AUDIT_PIPE_LOCK_ASSERT ( ap ) ; while ( ( ape = TAILQ_FIRST ( & ap -> ap_queue ) ) != NULL ) { TAILQ_REMOVE ( & ap -> ap_queue , ape , ape_queue ) ; ap -> ap_qbyteslen -= ape -> ape_record_len ; audit_pipe_entry_free ( ape ) ; ap -> ap_qlen -- ; } ap -> ap_qoffset = 0 ; KASSERT ( ap -> ap_qlen == 0 , ( " " ) ) ; KASSERT ( ap -> ap_qbyteslen == 0 , ( " " ) ) ; }
Flush all records currently present in an audit pipe; assume mutex is held.
Flush all records currently present in an audit pipe ; assume mutex is held .