summaryrefslogtreecommitdiff
path: root/usr.sbin/acpidump/acpi_user.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-01-05 14:13:30 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-01-05 14:13:30 +0000
commit37f7a76a50594875d8273b7f0c25613a3411c741 (patch)
tree894271c158c9f448af0e125bb867ac8f511ef759 /usr.sbin/acpidump/acpi_user.c
parentceb5f59b92727142e4d3d983bd66e55a8f606dbc (diff)
mmap returns MAP_FAILED on error, not -1 or NULL; from xsa@
Diffstat (limited to 'usr.sbin/acpidump/acpi_user.c')
-rw-r--r--usr.sbin/acpidump/acpi_user.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/acpidump/acpi_user.c b/usr.sbin/acpidump/acpi_user.c
index 4936decdfa6..62900e46aeb 100644
--- a/usr.sbin/acpidump/acpi_user.c
+++ b/usr.sbin/acpidump/acpi_user.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_user.c,v 1.3 2005/11/09 20:30:03 martin Exp $ */
+/* $OpenBSD: acpi_user.c,v 1.4 2007/01/05 14:13:29 otto Exp $ */
/*-
* Copyright (c) 1999 Doug Rabson
* Copyright (c) 2000 Mitsuru IWASAKI <iwasaki@FreeBSD.org>
@@ -25,7 +25,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: acpi_user.c,v 1.3 2005/11/09 20:30:03 martin Exp $
+ * $Id: acpi_user.c,v 1.4 2007/01/05 14:13:29 otto Exp $
* $FreeBSD: src/usr.sbin/acpi/acpidump/acpi_user.c,v 1.3 2000/11/08 02:37:00 iwasaki Exp $
*/
#include <sys/types.h>
@@ -88,7 +88,7 @@ acpi_user_find_mapping(vm_offset_t pa, size_t size)
map->pa = pa;
map->va = mmap(0, size, PROT_READ, MAP_SHARED, acpi_mem_fd, pa);
map->size = size;
- if ((long) map->va == -1)
+ if (map->va == MAP_FAILED)
err(1, "can't map address");
LIST_INSERT_HEAD(&maplist, map, link);
@@ -149,7 +149,7 @@ acpi_load_dsdt(char *dumpfile, u_int8_t **dpp, u_int8_t **endp)
}
dp = mmap(0, sb.st_size, PROT_READ, MAP_PRIVATE, acpi_mem_fd, 0);
- if (dp == NULL) {
+ if (dp == MAP_FAILED) {
errx(1, "mmap %s", dumpfile);
}