don't return (potential errno) + (potential errno), instead only perform
authormiod <miod@openbsd.org>
Fri, 6 Aug 2010 00:00:16 +0000 (00:00 +0000)
committermiod <miod@openbsd.org>
Fri, 6 Aug 2010 00:00:16 +0000 (00:00 +0000)
the second errno-capable function if the first one didn't fail.
ok deraadt@

sys/dev/pci/bktr/bktr_core.c

index 11c5da0..2f32c0c 100644 (file)
@@ -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);