summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2001-06-19 10:46:16 +0000
committerad <ad@NetBSD.org>2001-06-19 10:46:16 +0000
commit14edc766dfb0d1887be42d3db8ebcfec516dfd68 (patch)
treeff66f3aef17000023ab71a008bf1b48feb87ef9c
parentc8adbae640436193ed5dfb9a70e9b7af2dfc7278 (diff)
Check for transport failure before looking at the status code in the reply.
-rw-r--r--usr.sbin/iopctl/iopctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/iopctl/iopctl.c b/usr.sbin/iopctl/iopctl.c
index 6c654e8ed32..b60b3895fb7 100644
--- a/usr.sbin/iopctl/iopctl.c
+++ b/usr.sbin/iopctl/iopctl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: iopctl.c,v 1.9 2001/03/21 14:27:29 ad Exp $ */
+/* $NetBSD: iopctl.c,v 1.10 2001/06/19 10:46:16 ad Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#ifndef lint
#include <sys/cdefs.h>
-__RCSID("$NetBSD: iopctl.c,v 1.9 2001/03/21 14:27:29 ad Exp $");
+__RCSID("$NetBSD: iopctl.c,v 1.10 2001/06/19 10:46:16 ad Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -236,11 +236,11 @@ getparam(int tid, int group, void *pbuf, int pbufsize)
err(EXIT_FAILURE, "IOPIOCPT");
rf = (struct i2o_reply *)buf;
+ if ((rf->msgflags & I2O_MSGFLAGS_FAIL) != 0)
+ errx(EXIT_FAILURE, "I2O_UTIL_PARAMS_GET failed (FAIL)");
if (rf->reqstatus != 0)
errx(EXIT_FAILURE, "I2O_UTIL_PARAMS_GET failed (%d)",
((struct i2o_reply *)buf)->reqstatus);
- if ((rf->msgflags & I2O_MSGFLAGS_FAIL) != 0)
- errx(EXIT_FAILURE, "I2O_UTIL_PARAMS_GET failed (FAIL)");
}
void