DEFINES += -DLIBDIR='"$(libdir)"'
DEFINES += -DETCDIR='"$(etcdir)"'
-DEB_CFLAGS_MAINT_APPEND=-Wall -O3 -Wno-format-zero-length
+OPTIM =
+OPTIM += -g
+OPTIM += -O3
CC = gcc
LD = gcc
INCLUDES = -I.
-CPPFLAGS = `dpkg-buildflags --get CPPFLAGS` $(INCLUDES) $(DEFINES)
-CFLAGS = `dpkg-buildflags --get CFLAGS`
-LDFLAGS = `dpkg-buildflags --get LDFLAGS`
+CPPFLAGS = $(INCLUDES) $(DEFINES)
+CFLAGS = -Wall -Wformat-security $(OPTIM)
+LDFLAGS =
LDLIBS =
INSTALL = install -c -D -o root -g root
for (i = 0; up_commands[i] && *up_commands[i]; i++)
{
f->log(3, 0, 0, "Running %s\n", up_commands[i]);
- int status = system(up_commands[i]);
+ if (-1 == system(up_commands[i])) f->log(0, 0, 0, "error command %s\n", up_commands[i]);
}
return PLUGIN_RET_OK;
for (i = 0; down_commands[i] && *down_commands[i]; i++)
{
f->log(3, 0, 0, "Running %s\n", down_commands[i]);
- int status = system(down_commands[i]);
+ if (-1 == system(down_commands[i])) f->log(0, 0, 0, "error command %s\n", down_commands[i]);
}
}
for (i = 0; down_commands[i] && *down_commands[i]; i++)
{
f->log(3, 0, 0, "Running %s\n", down_commands[i]);
- int status = system(down_commands[i]);
+ if (-1 == system(down_commands[i])) f->log(0, 0, 0, "error command %s\n", down_commands[i]);
}
}
case 'd':
if (fork()) exit(0);
setsid();
- FILE *in = freopen("/dev/null", "r", stdin);
- FILE *out = freopen("/dev/null", "w", stdout);
- FILE *err = freopen("/dev/null", "w", stderr);
+ if(!freopen("/dev/null", "r", stdin)) LOG(0, 0, 0, "Error freopen stdin: %s\n", strerror(errno));
+ if(!freopen("/dev/null", "w", stdout)) LOG(0, 0, 0, "Error freopen stdout: %s\n", strerror(errno));
+ if(!freopen("/dev/null", "w", stderr)) LOG(0, 0, 0, "Error freopen stderr: %s\n", strerror(errno));
break;
case 'v':
optdebug++;
LOG(0, 0, 0, "Can't set ulimit: %s\n", strerror(errno));
// Make core dumps go to /tmp
- int ret = chdir("/tmp");
+ if(chdir("/tmp")) LOG(0, 0, 0, "Error chdir /tmp: %s\n", strerror(errno));
}
if (config->scheduler_fifo)