diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-03-07 14:54:50 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-03-07 14:54:50 +0000 |
commit | 658b91a300bbb62269d0f31a1f8648ae8755a167 (patch) | |
tree | 39cb3cc6e95a8170041c95cd3835bf798a0e65be | |
parent | f965706511ed81d4df675372b7485c4835325e26 (diff) |
- make a copyout into a copyin for correct semantics
- handle openfirmware error reports correctly
ok pb
-rw-r--r-- | sys/arch/sparc64/sparc64/openprom.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/sparc64/sparc64/openprom.c b/sys/arch/sparc64/sparc64/openprom.c index 0d3c4dc0a9e..ded08ae9db1 100644 --- a/sys/arch/sparc64/sparc64/openprom.c +++ b/sys/arch/sparc64/sparc64/openprom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openprom.c,v 1.9 2003/01/09 22:27:11 miod Exp $ */ +/* $OpenBSD: openprom.c,v 1.10 2003/03/07 14:54:49 jason Exp $ */ /* $NetBSD: openprom.c,v 1.4 2002/01/10 06:21:53 briggs Exp $ */ /* @@ -217,15 +217,15 @@ openpromioctl(dev, cmd, data, flags, p) s = splhigh(); error = OF_nextprop(node, name, nextprop); splx(s); + if (error == -1) { + error = EINVAL; + break; + } if (error == 0) { - char nul = 0; + char nul = '\0'; op->op_buflen = 0; - error = copyin(&nul, op->op_buf, sizeof(char)); - break; - } - if (error == -1) { - error = EINVAL; + error = copyout(&nul, op->op_buf, sizeof(char)); break; } len = strlen(nextprop); |