summaryrefslogtreecommitdiff
path: root/src/rc/start-stop-daemon.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-10-06 15:02:32 +0000
committerRoy Marples <roy@marples.name>2008-10-06 15:02:32 +0000
commitcb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413 (patch)
treec203264849ad86d67ddfb86242ef2aa0680a9b8b /src/rc/start-stop-daemon.c
parent4e4c4a5bf4d5c463b79b5648e614b3b780efdbec (diff)
downloadopenrc-cb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413.tar.gz
openrc-cb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413.tar.bz2
openrc-cb44b0a46c9b1c72a84cf65e6b4d6ae735c0e413.tar.xz
#ifdef atexit cleanups calling free as the OS should do this for us, but valgrind debuggers need it.
Diffstat (limited to 'src/rc/start-stop-daemon.c')
-rw-r--r--src/rc/start-stop-daemon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c
index e367345..463983e 100644
--- a/src/rc/start-stop-daemon.c
+++ b/src/rc/start-stop-daemon.c
@@ -116,13 +116,14 @@ static void free_schedulelist(void)
TAILQ_INIT(&schedule);
}
+#ifdef DEBUG_MEMORY
static void cleanup(void)
{
free(changeuser);
free(nav);
-
free_schedulelist();
}
+#endif
static int parse_signal(const char *sig)
{
@@ -609,7 +610,9 @@ int start_stop_daemon(int argc, char **argv)
unsigned int start_wait = 0;
TAILQ_INIT(&schedule);
+#ifdef DEBUG_MEMORY
atexit(cleanup);
+#endif
signal_setup(SIGINT, handle_signal);
signal_setup(SIGQUIT, handle_signal);