diff options
| author | Eivind Eklund <eivind@FreeBSD.org> | 1999-01-08 17:31:30 +0000 |
|---|---|---|
| committer | Eivind Eklund <eivind@FreeBSD.org> | 1999-01-08 17:31:30 +0000 |
| commit | 5526d2d920eb17b1507499f35b275b486f7fe8d0 (patch) | |
| tree | c3aa8110c730b536d4b76b776fd65a60d1a70818 /sys/kern/kern_subr.c | |
| parent | 95ddc5daa5374332a4bc16c64c498099fa823adf (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_subr.c')
| -rw-r--r-- | sys/kern/kern_subr.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 548cd20e1c8b..d775d970a5ce 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_subr.c 8.3 (Berkeley) 1/21/94 - * $Id: kern_subr.c,v 1.21 1998/07/15 02:32:10 bde Exp $ + * $Id: kern_subr.c,v 1.22 1998/08/04 09:21:04 phk Exp $ */ #include <sys/param.h> @@ -61,12 +61,11 @@ uiomove(cp, n, uio) u_int cnt; int error; -#ifdef DIAGNOSTIC - if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE) - panic("uiomove: mode"); - if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc) - panic("uiomove proc"); -#endif + KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, + ("uiomove: mode")); + KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_procp == curproc, + ("uiomove proc")); + while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -120,12 +119,11 @@ uiomoveco(cp, n, uio, obj) u_int cnt; int error; -#ifdef DIAGNOSTIC - if (uio->uio_rw != UIO_READ && uio->uio_rw != UIO_WRITE) - panic("uiomove: mode"); - if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc) - panic("uiomove proc"); -#endif + KASSERT(uio->uio_rw == UIO_READ || uio->uio_rw == UIO_WRITE, + ("uiomoveco: mode")); + KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_procp == curproc, + ("uiomoveco proc")); + while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; |
