diff options
Diffstat (limited to 'meta/recipes-devtools/qemu/qemu/0012-tpm-Use-EMSGSIZE-instead-of-EBADMSG-to-compile-on-Op.patch')
-rw-r--r-- | meta/recipes-devtools/qemu/qemu/0012-tpm-Use-EMSGSIZE-instead-of-EBADMSG-to-compile-on-Op.patch | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/meta/recipes-devtools/qemu/qemu/0012-tpm-Use-EMSGSIZE-instead-of-EBADMSG-to-compile-on-Op.patch b/meta/recipes-devtools/qemu/qemu/0012-tpm-Use-EMSGSIZE-instead-of-EBADMSG-to-compile-on-Op.patch deleted file mode 100644 index 430fe1b1c4..0000000000 --- a/meta/recipes-devtools/qemu/qemu/0012-tpm-Use-EMSGSIZE-instead-of-EBADMSG-to-compile-on-Op.patch +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | From c559d599c6880caf7aa0f0a60c6c023584e1b8ad Mon Sep 17 00:00:00 2001 | ||
2 | From: Stefan Berger <stefanb@linux.vnet.ibm.com> | ||
3 | Date: Wed, 11 Oct 2017 08:52:43 -0400 | ||
4 | Subject: [PATCH 12/12] tpm: Use EMSGSIZE instead of EBADMSG to compile on | ||
5 | OpenBSD | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | EBADMSG was only added to OpenBSD very recently. To make QEMU compilable | ||
11 | on older OpenBSD versions use EMSGSIZE instead when a mismatch between | ||
12 | number of received bytes and message size indicated in the header was | ||
13 | found. | ||
14 | |||
15 | Return -EMSGSIZE and convert all other errnos in the same functions to | ||
16 | return the negative errno. | ||
17 | |||
18 | Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> | ||
19 | Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> | ||
20 | |||
21 | Upstream-Status: Backport [98979cdca44ba0e21055ee7736694aa5ebb54347] | ||
22 | --- | ||
23 | hw/tpm/tpm_util.c | 10 +++++----- | ||
24 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
25 | |||
26 | diff --git a/hw/tpm/tpm_util.c b/hw/tpm/tpm_util.c | ||
27 | index fb929f6e92..73d77965fd 100644 | ||
28 | --- a/hw/tpm/tpm_util.c | ||
29 | +++ b/hw/tpm/tpm_util.c | ||
30 | @@ -68,10 +68,10 @@ static int tpm_util_test(int fd, | ||
31 | |||
32 | n = write(fd, request, requestlen); | ||
33 | if (n < 0) { | ||
34 | - return errno; | ||
35 | + return -errno; | ||
36 | } | ||
37 | if (n != requestlen) { | ||
38 | - return EFAULT; | ||
39 | + return -EFAULT; | ||
40 | } | ||
41 | |||
42 | FD_ZERO(&readfds); | ||
43 | @@ -80,18 +80,18 @@ static int tpm_util_test(int fd, | ||
44 | /* wait for a second */ | ||
45 | n = select(fd + 1, &readfds, NULL, NULL, &tv); | ||
46 | if (n != 1) { | ||
47 | - return errno; | ||
48 | + return -errno; | ||
49 | } | ||
50 | |||
51 | n = read(fd, &buf, sizeof(buf)); | ||
52 | if (n < sizeof(struct tpm_resp_hdr)) { | ||
53 | - return EFAULT; | ||
54 | + return -EFAULT; | ||
55 | } | ||
56 | |||
57 | resp = (struct tpm_resp_hdr *)buf; | ||
58 | /* check the header */ | ||
59 | if (be32_to_cpu(resp->len) != n) { | ||
60 | - return EBADMSG; | ||
61 | + return -EMSGSIZE; | ||
62 | } | ||
63 | |||
64 | *return_tag = be16_to_cpu(resp->tag); | ||
65 | -- | ||
66 | 2.11.0 | ||
67 | |||