[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] tpm: Use EMSGSIZE instead of EBADMSG to compile on
From: |
Stefan Berger |
Subject: |
[Qemu-devel] [PATCH] tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD |
Date: |
Wed, 11 Oct 2017 08:59:32 -0400 |
EMSGSIZE was only added to OpenBSD very recently. To make QEMU
compileable on older OpenBSD versions use EMSGSIZE instead when
a mismatch between number of received bytes and message size in-
dicated in the header was found.
Signed-off-by: Stefan Berger <address@hidden>
---
hw/tpm/tpm_util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/tpm/tpm_util.c b/hw/tpm/tpm_util.c
index fb929f6..1129155 100644
--- a/hw/tpm/tpm_util.c
+++ b/hw/tpm/tpm_util.c
@@ -91,7 +91,7 @@ static int tpm_util_test(int fd,
resp = (struct tpm_resp_hdr *)buf;
/* check the header */
if (be32_to_cpu(resp->len) != n) {
- return EBADMSG;
+ return EMSGSIZE;
}
*return_tag = be16_to_cpu(resp->tag);
--
2.5.5
- [Qemu-devel] [PATCH] tpm: Use EMSGSIZE instead of EBADMSG to compile on OpenBSD,
Stefan Berger <=