aboutsummaryrefslogtreecommitdiff
path: root/sbin/dmesg
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2005-01-17 13:56:46 +0000
committerXin LI <delphij@FreeBSD.org>2005-01-17 13:56:46 +0000
commit57517b0931f1443a5d07ed683d8e1f7176536f87 (patch)
tree93e4e27d3b9814248d6ec29fc84c8aa750ac45e6 /sbin/dmesg
parenta074c8897c7bb932ca868f24d70ec7f4e6d5333b (diff)
downloadsrc-57517b0931f1443a5d07ed683d8e1f7176536f87.tar.gz
src-57517b0931f1443a5d07ed683d8e1f7176536f87.zip
WARNS=6 cleanup:
- signed/unsigned conform. - Better initialization of nlist[]. I think we should have something like NLIST_NULL instead of the current (ugly) form...
Notes
Notes: svn path=/head/; revision=140383
Diffstat (limited to 'sbin/dmesg')
-rw-r--r--sbin/dmesg/Makefile3
-rw-r--r--sbin/dmesg/dmesg.c10
2 files changed, 9 insertions, 4 deletions
diff --git a/sbin/dmesg/Makefile b/sbin/dmesg/Makefile
index 777956357ae0..8472f56c461f 100644
--- a/sbin/dmesg/Makefile
+++ b/sbin/dmesg/Makefile
@@ -3,6 +3,9 @@
PROG= dmesg
MAN= dmesg.8
+
+WARNS?= 6
+
LDADD= -lkvm
DPADD= ${LIBKVM}
diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c
index c0f4b5a0e5e6..d1f7ef5c56d9 100644
--- a/sbin/dmesg/dmesg.c
+++ b/sbin/dmesg/dmesg.c
@@ -59,10 +59,12 @@ __FBSDID("$FreeBSD$");
#include <vis.h>
#include <sys/syslog.h>
+char s_msgbufp[] = "_msgbufp";
+
struct nlist nl[] = {
#define X_MSGBUF 0
- { "_msgbufp" },
- { NULL },
+ { s_msgbufp, 0, 0, 0, 0 },
+ { NULL, 0, 0, 0, 0 },
};
void usage(void) __dead2;
@@ -134,10 +136,10 @@ main(int argc, char *argv[])
/* Unwrap the circular buffer to start from the oldest data. */
bufpos = MSGBUF_SEQ_TO_POS(&cur, cur.msg_wseq);
if (kvm_read(kd, (long)&cur.msg_ptr[bufpos], bp,
- cur.msg_size - bufpos) != cur.msg_size - bufpos)
+ cur.msg_size - bufpos) != (ssize_t)(cur.msg_size - bufpos))
errx(1, "kvm_read: %s", kvm_geterr(kd));
if (bufpos != 0 && kvm_read(kd, (long)cur.msg_ptr,
- &bp[cur.msg_size - bufpos], bufpos) != bufpos)
+ &bp[cur.msg_size - bufpos], bufpos) != (ssize_t)bufpos)
errx(1, "kvm_read: %s", kvm_geterr(kd));
kvm_close(kd);
buflen = cur.msg_size;