BUILD: dumpstats: fix build error on Solaris

Since the recent addition of map updates, haproxy does not build anymore
on Solaris because "s_addr" is a #define :

src/dumpstats.c: In function `stats_map_lookup':
src/dumpstats.c:4688: error: syntax error before '.' token
src/dumpstats.c:4781: error: `S_un' undeclared (first use in this function)
src/dumpstats.c:4781: error: (Each undeclared identifier is reported only once
src/dumpstats.c:4781: error: for each function it appears in.)
make: *** [src/dumpstats.o] Error 1

Simply rename the variable.
This commit is contained in:
Willy Tarreau 2013-12-16 01:42:03 +01:00
parent 0f28f82cec
commit b908befdae
1 changed files with 3 additions and 3 deletions

View File

@ -4685,7 +4685,7 @@ static int stats_map_lookup(struct stream_interface *si)
struct pat_idx_elt *elt;
enum pat_match_res res;
struct sockaddr_in addr;
char s_addr[INET_ADDRSTRLEN];
char addr_str[INET_ADDRSTRLEN];
switch (appctx->st2) {
case STAT_ST_INIT:
@ -4778,8 +4778,8 @@ static int stats_map_lookup(struct stream_interface *si)
/* convert ip */
memcpy(&addr.sin_addr, elt->node.key, 4);
addr.sin_family = AF_INET;
if (addr_to_str((struct sockaddr_storage *)&addr, s_addr, INET_ADDRSTRLEN))
chunk_appendf(&trash, "match=\"%s/%d\", ", s_addr, elt->node.node.pfx);
if (addr_to_str((struct sockaddr_storage *)&addr, addr_str, INET_ADDRSTRLEN))
chunk_appendf(&trash, "match=\"%s/%d\", ", addr_str, elt->node.node.pfx);
}
}
}