MINOR: warning on multiple -x
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 19 Jun 2017 14:37:19 +0000 (16:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:43:28 +0000 (14:43 +0200)
Multiple use of the -x option is useless, emit a warning.

src/haproxy.c

index 2fd387f..1eabb55 100644 (file)
@@ -1283,7 +1283,10 @@ static void init(int argc, char **argv)
                                        Alert("Unix socket path expected with the -x flag\n\n");
                                        usage(progname);
                                }
+                               if (old_unixsocket)
+                                       Warning("-x option already set, overwriting the value\n");
                                old_unixsocket = argv[1];
+
                                argv++;
                                argc--;
                        }