Module: check_mk
Branch: master
Commit: 2f07f6bd1bf567694a41ec6cb2067062e055ff93
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2f07f6bd1bf567…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Nov 24 13:41:22 2015 +0100
Avoid warnings from diet. Fixed types and initialization.
---
agents/waitmax.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/agents/waitmax.c b/agents/waitmax.c
index 2c21ed9..c4ce4c7 100644
--- a/agents/waitmax.c
+++ b/agents/waitmax.c
@@ -31,9 +31,9 @@
#include <sys/wait.h>
#include <unistd.h>
-static int g_pid;
+static pid_t g_pid = 0;
static int g_timeout = 0;
-static int g_signum = 15;
+static int g_signum = SIGTERM;
static void out(const char *buf)
{
@@ -99,11 +99,10 @@ static struct option long_options[] = {{"version",
no_argument, 0, 'V'},
int main(int argc, char **argv)
{
- int indexptr = 0;
+ /* Note: setenv calls malloc, and 'diet' warns about that. */
+ if (getenv("POSIXLY_CORRECT") == NULL)
putenv("POSIXLY_CORRECT=true");
int ret;
- setenv("POSIXLY_CORRECT", "true", 0);
- while (0 <=
- (ret = getopt_long(argc, argv, "Vhs:", long_options,
&indexptr))) {
+ while ((ret = getopt_long(argc, argv, "Vhs:", long_options, NULL)) != -1)
{
switch (ret) {
case 'V': version(); break;