PERFORCE change 91244 for review
Robert Watson
rwatson at FreeBSD.org
Mon Feb 6 17:09:13 GMT 2006
http://perforce.freebsd.org/chv.cgi?CH=91244
Change 91244 by rwatson at 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);
/*
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list