diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-05 18:45:18 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-05 18:45:18 +0000 |
commit | cc9cc9b47e10304de0196eb8e4362c3e9fcb503d (patch) | |
tree | 8019851a4bcee37b0162b5846e04f05cb3d35f5e /sbin/dmesg/dmesg.c | |
parent | e1335495d4ae370dd6b02c621ff541db5ac97050 (diff) |
split KREAD() calls
Diffstat (limited to 'sbin/dmesg/dmesg.c')
-rw-r--r-- | sbin/dmesg/dmesg.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c index e0475239c82..dd5edb3ba45 100644 --- a/sbin/dmesg/dmesg.c +++ b/sbin/dmesg/dmesg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dmesg.c,v 1.5 1997/03/29 20:28:20 tholo Exp $ */ +/* $OpenBSD: dmesg.c,v 1.6 1998/07/05 18:45:17 deraadt Exp $ */ /* $NetBSD: dmesg.c,v 1.8 1995/03/18 14:54:49 cgd Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)dmesg.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$OpenBSD: dmesg.c,v 1.5 1997/03/29 20:28:20 tholo Exp $"; +static char rcsid[] = "$OpenBSD: dmesg.c,v 1.6 1998/07/05 18:45:17 deraadt Exp $"; #endif #endif /* not lint */ @@ -117,8 +117,12 @@ main(argc, argv) errx(1, "kvm_nlist: %s", kvm_geterr(kd)); if (nl[X_MSGBUF].n_type == 0) errx(1, "%s: msgbufp not found", nlistf ? nlistf : "namelist"); - if (KREAD(nl[X_MSGBUF].n_value, bufp) || KREAD((long)bufp, cur)) - errx(1, "kvm_read: %s", kvm_geterr(kd)); + if (KREAD(nl[X_MSGBUF].n_value, bufp)) + errx(1, "kvm_read: %s: (0x%lx)", kvm_geterr(kd), + nl[X_MSGBUF].n_value); + if (KREAD((long)bufp, cur)) + errx(1, "kvm_read: %s (%0lx)", kvm_geterr(kd), + (unsigned long)bufp); kvm_close(kd); if (cur.msg_magic != MSG_MAGIC) errx(1, "magic number incorrect"); |