Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Mar 2015 20:24:34 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r279673 - head/usr.sbin/bhyve
Message-ID:  <201503052024.t25KOY5r055793@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Mar  5 20:24:34 2015
New Revision: 279673
URL: https://svnweb.freebsd.org/changeset/base/279673

Log:
  Fix error translation broken in r279658.
  
  Reported by:	grehan
  MFC after:	2 weeks

Modified:
  head/usr.sbin/bhyve/pci_virtio_block.c

Modified: head/usr.sbin/bhyve/pci_virtio_block.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_block.c	Thu Mar  5 20:22:28 2015	(r279672)
+++ head/usr.sbin/bhyve/pci_virtio_block.c	Thu Mar  5 20:24:34 2015	(r279673)
@@ -246,12 +246,11 @@ pci_vtblk_proc(struct pci_vtblk_softc *s
 	}
 
 	/* convert errno into a virtio block error return */
-	if (err < 0) {
-		if (err == -ENOSYS)
-			*status = VTBLK_S_UNSUPP;
-		else
-			*status = VTBLK_S_IOERR;
-	} else
+	if (err == -ENOSYS)
+		*status = VTBLK_S_UNSUPP;
+	else if (err != 0)
+		*status = VTBLK_S_IOERR;
+	else
 		*status = VTBLK_S_OK;
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503052024.t25KOY5r055793>