Date: Mon, 6 Feb 2006 17:09:13 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 91244 for review Message-ID: <200602061709.k16H9D39069366@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602061709.k16H9D39069366>