mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-16 08:24:42 +00:00
BUG/MINOR: Fix search for -p argument in systemd wrapper.
Searching for the pid file in the list of arguments did not take flags without parameters into account, like e.g. -de. Because of this, the wrapper would use a different pid file than haproxy if such an argument was specified before -p. The new version can still yield a false positive for some crazy situations, like your config file name starting with "-p", but I think this is as good as it gets without using getopt or some library. Signed-off-by: Conrad Hoffmann <conrad@soundcloud.com>
This commit is contained in:
parent
e468d55998
commit
eb2cf45b72
@ -130,11 +130,8 @@ static void sigint_handler(int signum __attribute__((unused)))
|
||||
static void init(int argc, char **argv)
|
||||
{
|
||||
while (argc > 1) {
|
||||
if (**argv == '-') {
|
||||
char *flag = *argv + 1;
|
||||
--argc; ++argv;
|
||||
if (*flag == 'p')
|
||||
pid_file = *argv;
|
||||
if ((*argv)[0] == '-' && (*argv)[1] == 'p') {
|
||||
pid_file = *(argv + 1);
|
||||
}
|
||||
--argc; ++argv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user