]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: dumpstats: fix build error on Solaris
authorWilly Tarreau <w@1wt.eu>
Mon, 16 Dec 2013 00:42:03 +0000 (01:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 16 Dec 2013 01:23:51 +0000 (02:23 +0100)
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.

src/dumpstats.c

index 25aa47185ff08635e10f05c8972c13cdd4d79ba0..d39da4143f01e04f0fc3892e1841f6a64c2ccd0f 100644 (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);
                                        }
                                }
                        }