support: struct netent portability fix for support_format_netent

This commit is contained in:
Florian Weimer 2017-01-01 09:35:45 +01:00
parent 8e2c31b57f
commit 73dfd08893
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2017-01-01 Florian Weimer <fweimer@redhat.com>
* support/support_format_netent.c (support_format_netent): Work
around alpha struct netent definition difference.
2017-01-01 Florian Weimer <fweimer@redhat.com>
* support/xwrite.c (xwrite): Use %td for pointer difference.

View File

@ -43,7 +43,9 @@ support_format_netent (struct netent *e)
fprintf (mem.out, "alias: %s\n", *ap);
if (e->n_addrtype != AF_INET)
fprintf (mem.out, "addrtype: %d\n", e->n_addrtype);
fprintf (mem.out, "net: 0x%08x\n", e->n_net);
/* On alpha, e->n_net is an unsigned long. */
unsigned int n_net = e->n_net;
fprintf (mem.out, "net: 0x%08x\n", n_net);
xfclose_memstream (&mem);
return mem.buffer;