From 28b4928b1b1735bcacafb2f2e6a928020154a09b Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Sat, 14 Mar 2020 00:21:40 -0400 Subject: [PATCH] Fix nscd/cachedumper.c compile errors --- nscd/cachedumper.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nscd/cachedumper.c b/nscd/cachedumper.c index c5bd370918..4c314e0099 100644 --- a/nscd/cachedumper.c +++ b/nscd/cachedumper.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "nscd.h" #include "dbg_log.h" @@ -137,8 +138,8 @@ nscd_print_cache (const char *name) data_string (key, "", here->len); struct datahead *dh = (struct datahead *) (data + here->packet); - printf ("\" (len:%d) Data %08lx\n", here->len, - (char *) dh - (char *) the_cache); + printf ("\" (len:%ld) Data %08lx\n", (long) here->len, + (long unsigned int) ((char *) dh - (char *) the_cache)); if (debug_level > 0) { @@ -256,8 +257,9 @@ nscd_print_cache (const char *name) case GETAI: { ai_response_header *ai = &(dh->data[0].aidata); - printf (" naddrs %d addrslen %d canonlen %d error %d [", - ai->naddrs, ai->addrslen, ai->canonlen, ai->error); + printf (" naddrs %ld addrslen %ld canonlen %ld error %d [", + (long) ai->naddrs, (long) ai->addrslen, + (long) ai->canonlen, ai->error); cp += sizeof (*ai); unsigned char *addrs = cp; unsigned char *families = cp + ai->addrslen; @@ -305,8 +307,8 @@ nscd_print_cache (const char *name) case GETSERVBYPORT: { serv_response_header *serv = &(dh->data[0].servdata); - printf (" alias_cnt %d port %d (stored as %d)", - serv->s_aliases_cnt, + printf (" alias_cnt %ld port %d (stored as %d)", + (long) serv->s_aliases_cnt, ((serv->s_port & 0xff00) >> 8) | ((serv-> s_port & 0xff) << 8), serv->s_port);