From: Cyril Bonté Date: Tue, 3 Mar 2015 22:26:14 +0000 (+0100) Subject: BUILD/CLEANUP: systemd: avoid a warning due to mixed code and declaration X-Git-Tag: v1.6-dev1~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d1039e5dc5a7d08ca4451155d363d62e236b85c2;p=thirdparty%2Fhaproxy.git BUILD/CLEANUP: systemd: avoid a warning due to mixed code and declaration Gcc complains because the systemd wrapper mixed code and declaration : "warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]". --- diff --git a/src/haproxy-systemd-wrapper.c b/src/haproxy-systemd-wrapper.c index 8602881e75..e588af931c 100644 --- a/src/haproxy-systemd-wrapper.c +++ b/src/haproxy-systemd-wrapper.c @@ -163,6 +163,7 @@ static void init(int argc, char **argv) int main(int argc, char **argv) { int status; + struct sigaction sa; wrapper_argc = argc; wrapper_argv = argv; @@ -170,7 +171,6 @@ int main(int argc, char **argv) --argc; ++argv; init(argc, argv); - struct sigaction sa; memset(&sa, 0, sizeof(struct sigaction)); sa.sa_handler = &signal_handler; sigaction(SIGUSR2, &sa, NULL);