看板 DFBSD_submit 關於我們 聯絡資訊
--UFHRwCdBEJvubb2X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Apologies, got the wrong version of nlist.h. Here's the correct patch. -- / Peter Schuller, InfiDyne Technologies HB PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>' Key retrieval: Send an E-Mail to getpgpkey@scode.org E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org --UFHRwCdBEJvubb2X Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dmesg.patch" --- sbin/dmesg/dmesg.c.orig 2005-01-08 08:37:34.000000000 +0000 +++ sbin/dmesg/dmesg.c 2005-01-08 08:39:07.000000000 +0000 @@ -52,8 +52,8 @@ struct nlist nl[] = { #define X_MSGBUF 0 - { "_msgbufp" }, - { NULL }, + NLIST_NAME("_msgbufp"), + NLIST_NULL, }; void usage(void); @@ -72,8 +72,7 @@ char buf[5]; int all = 0; int pri = 0; - size_t buflen; - int bufpos; + size_t buflen, bufpos; setlocale(LC_CTYPE, ""); memf = nlistf = NULL; @@ -124,7 +123,7 @@ if (!bp) errx(1, "malloc failed"); if (kvm_read(kd, (long)cur.msg_ptr, bp, cur.msg_size) != - cur.msg_size) + (ssize_t)cur.msg_size) errx(1, "kvm_read: %s", kvm_geterr(kd)); kvm_close(kd); buflen = cur.msg_size; --- include/nlist.h.orig 2005-01-08 08:33:27.000000000 +0000 +++ include/nlist.h 2005-01-08 09:11:42.000000000 +0000 @@ -68,6 +68,12 @@ unsigned long n_value; /* address/value of the symbol */ }; +/* Initializes an nlist with the given n_name but otherwise zeroed */ +#define NLIST_NAME(name) { name, 0, '\0', 0, 0 } + +/* Terminates arrays of nlist structures */ +#define NLIST_NULL { NULL, 0, '\0', 0, 0 } + #define n_hash n_desc /* used internally by ld(1); XXX */ /* --UFHRwCdBEJvubb2X--