]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: "show cli sockets" would always report process 64
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Dec 2016 11:56:31 +0000 (12:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Dec 2016 11:59:00 +0000 (12:59 +0100)
Another small bug in "show cli sockets" made the last fix always report
process 64 due to a signedness issue in the shift operation when building
the mask.

src/cli.c

index 6fd7455c9cb40e59b33e4af0f36d5c1fd96c0376..a875d384485c906f3de8f0af4e8eb7b43d7b3a66 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -798,9 +798,8 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx)
 
                                                if (bind_conf->bind_proc != 0) {
                                                        int pos;
-
                                                        for (pos = 0; pos < 8 * sizeof(bind_conf->bind_proc); pos++) {
-                                                               if (bind_conf->bind_proc & (1 << pos)) {
+                                                               if (bind_conf->bind_proc & (1UL << pos)) {
                                                                        chunk_appendf(&trash, "%d,", pos+1);
                                                                }
                                                        }