diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-09-11 10:40:36 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2022-09-11 10:40:36 +0000 |
commit | 74f2fd91637e838f0cd8eeb03ae22e25eaa20b7b (patch) | |
tree | bc93e976cb86bb3f0372483ae98a868e9836b378 | |
parent | 96517bb9760f31cf4aa963beb925d57581f6df57 (diff) |
When looking up a symble using kvm_nlist(3), we need to prepend an
underscore. This fixes acpidump on arm64. How this ever worked before
is unclear, but part of the puzzle is that we didn't properly check the
return value of the kvm_nlist(3) calls. So fix that too.
ok deraadt@, mglocker@
-rw-r--r-- | usr.sbin/acpidump/acpidump.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/acpidump/acpidump.c b/usr.sbin/acpidump/acpidump.c index e08a6edada9..8171b8f9bed 100644 --- a/usr.sbin/acpidump/acpidump.c +++ b/usr.sbin/acpidump/acpidump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidump.c,v 1.24 2021/07/12 15:09:20 beck Exp $ */ +/* $OpenBSD: acpidump.c,v 1.25 2022/09/11 10:40:35 kettenis Exp $ */ /* * Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org> * All rights reserved. @@ -714,8 +714,8 @@ efi_acpi_addr(void) kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL); if (kd == NULL) goto on_error; - nl[0].n_name = "efi_acpi_table"; - if (kvm_nlist(kd, nl) == -1) + nl[0].n_name = "_efi_acpi_table"; + if (kvm_nlist(kd, nl) != 0) goto on_error; if (kvm_read(kd, nl[0].n_value, &table, sizeof(table)) == -1) goto on_error; @@ -746,7 +746,7 @@ efi_acpi_addr(void) if (kd == NULL) goto on_error; nl[0].n_name = "_bios_efiinfo"; - if (kvm_nlist(kd, nl) == -1) + if (kvm_nlist(kd, nl) != 0) goto on_error; if (kvm_read(kd, nl[0].n_value, &ptr, sizeof(ptr)) == -1) goto on_error; |