From owner-p4-projects@FreeBSD.ORG Mon Feb 6 17:09:14 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4A20516A423; Mon, 6 Feb 2006 17:09:14 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0938516A420 for ; Mon, 6 Feb 2006 17:09:14 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF71243D48 for ; Mon, 6 Feb 2006 17:09:13 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k16H9DRQ069369 for ; Mon, 6 Feb 2006 17:09:13 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k16H9D39069366 for perforce@freebsd.org; Mon, 6 Feb 2006 17:09:13 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 6 Feb 2006 17:09:13 GMT Message-Id: <200602061709.k16H9D39069366@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 91244 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2006 17:09:15 -0000 http://perforce.freebsd.org/chv.cgi?CH=91244 Change 91244 by rwatson@rwatson_zoo on 2006/02/06 17:08:25 Fix logic in last submit, it wasn't quite right. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_pipe.c#4 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit_pipe.c#4 (text+ko) ==== @@ -399,22 +399,25 @@ ap = dev->si_drv1; KASSERT(ap != NULL, ("audit_pipe_read: ap == NULL")); ape = audit_pipe_pop(ap); - while ((ape = audit_pipe_pop(ap)) == NULL) { - error = cv_wait_sig(&audit_pipe_cv, &audit_pipe_mtx); - if (error) { - mtx_unlock(&audit_pipe_mtx); - return (error); - } + do { /* - * Simply drop records that are too long and keep waiting, as - * this helps maintain the discreet record interface. + * Wait for a record that fits into the read buffer, dropping + * records that would be truncated if actually passed to the + * process. This helps maintain the discreet record read + * interface. */ - if (ape->ape_record_len < uio->uio_resid) { - audit_pipe_entry_free(ape); - ap->ap_truncates++; - continue; + while ((ape = audit_pipe_pop(ap)) == NULL) { + error = cv_wait_sig(&audit_pipe_cv, &audit_pipe_mtx); + if (error) { + mtx_unlock(&audit_pipe_mtx); + return (error); + } } - } + if (ape->ape_record_len <= uio->uio_resid) + break; + audit_pipe_entry_free(ape); + ap->ap_truncates++; + } while (1); mtx_unlock(&audit_pipe_mtx); /*