From 20cd04e4447b62ff5075f20f04bd279c94a0a7a8 Mon Sep 17 00:00:00 2001 From: miod Date: Fri, 6 Aug 2010 00:00:16 +0000 Subject: [PATCH] don't return (potential errno) + (potential errno), instead only perform the second errno-capable function if the first one didn't fail. ok deraadt@ --- sys/dev/pci/bktr/bktr_core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/bktr/bktr_core.c b/sys/dev/pci/bktr/bktr_core.c index 11c5da0b264..2f32c0ceb55 100644 --- a/sys/dev/pci/bktr/bktr_core.c +++ b/sys/dev/pci/bktr/bktr_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bktr_core.c,v 1.28 2009/11/09 17:53:39 nicm Exp $ */ +/* $OpenBSD: bktr_core.c,v 1.29 2010/08/06 00:00:16 miod Exp $ */ /* $FreeBSD: src/sys/dev/bktr/bktr_core.c,v 1.114 2000/10/31 13:09:56 roger Exp $ */ /* @@ -1077,7 +1077,8 @@ vbi_read(bktr_ptr_t bktr, struct uio *uio, int ioflag) readsize2 = VBI_BUFFER_SIZE - bktr->vbistart; status = uiomove((caddr_t)bktr->vbibuffer + bktr->vbistart, readsize2, uio); - status += uiomove((caddr_t)bktr->vbibuffer, (readsize - readsize2), uio); + if (status == 0) + status = uiomove((caddr_t)bktr->vbibuffer, (readsize - readsize2), uio); } else { /* We do not need to wrap around */ status = uiomove((caddr_t)bktr->vbibuffer + bktr->vbistart, readsize, uio); -- 2.20.1