diff options
author | William Hubbs <w.d.hubbs@gmail.com> | 2015-03-22 15:04:14 -0500 |
---|---|---|
committer | William Hubbs <w.d.hubbs@gmail.com> | 2016-07-14 16:52:57 -0500 |
commit | 3a1262703fd20d2e8288d13d908fb282c77d1793 (patch) | |
tree | 9dc39a57e849c7543ea153f59f431669d9b0a666 /src/rc | |
parent | 20035210bdf5d5729734457f35f5f32a53a5b3ad (diff) |
Remove the DEBUG_MEMORY macro
This fixes #43.
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/openrc-run.c | 4 | ||||
-rw-r--r-- | src/rc/rc-misc.c | 2 | ||||
-rw-r--r-- | src/rc/rc-service.c | 6 | ||||
-rw-r--r-- | src/rc/rc-status.c | 2 | ||||
-rw-r--r-- | src/rc/rc.c | 16 | ||||
-rw-r--r-- | src/rc/start-stop-daemon.c | 4 |
6 files changed, 6 insertions, 28 deletions
diff --git a/src/rc/openrc-run.c b/src/rc/openrc-run.c index 275cb320..ff884c47 100644 --- a/src/rc/openrc-run.c +++ b/src/rc/openrc-run.c @@ -247,7 +247,6 @@ cleanup(void) rc_plugin_unload(); -#ifdef DEBUG_MEMORY rc_stringlist_free(deptypes_b); rc_stringlist_free(deptypes_n); rc_stringlist_free(deptypes_nw); @@ -267,7 +266,6 @@ cleanup(void) free(service); free(prefix); free(runlevel); -#endif } /* Buffer and lock all output messages so that we get readable content */ @@ -1097,9 +1095,7 @@ service_plugable(void) break; } } -#ifdef DEBUG_MEMORY free(list); -#endif return allow; } diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c index 82f1b780..85a0db75 100644 --- a/src/rc/rc-misc.c +++ b/src/rc/rc-misc.c @@ -110,11 +110,9 @@ env_filter(void) setenv(env->value, e + 1, 1); } -#ifdef DEBUG_MEMORY rc_stringlist_free(env_list); rc_stringlist_free(env_allow); rc_stringlist_free(profile); -#endif } void diff --git a/src/rc/rc-service.c b/src/rc/rc-service.c index 3fd94b25..d0a64999 100644 --- a/src/rc/rc-service.c +++ b/src/rc/rc-service.c @@ -76,9 +76,7 @@ int main(int argc, char **argv) case 'e': service = rc_service_resolve(optarg); opt = service ? EXIT_SUCCESS : EXIT_FAILURE; -#ifdef DEBUG_MEMORY free(service); -#endif return opt; /* NOTREACHED */ case 'i': @@ -97,9 +95,7 @@ int main(int argc, char **argv) rc_stringlist_sort(&list); TAILQ_FOREACH(s, list, entries) printf("%s\n", s->value); -#ifdef DEBUG_MEMORY rc_stringlist_free(list); -#endif return EXIT_SUCCESS; /* NOTREACHED */ case 'r': @@ -107,9 +103,7 @@ int main(int argc, char **argv) if (service == NULL) return EXIT_FAILURE; printf("%s\n", service); -#ifdef DEBUG_MEMORY free(service); -#endif return EXIT_SUCCESS; /* NOTREACHED */ diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c index a0a2fcec..6724db89 100644 --- a/src/rc/rc-status.c +++ b/src/rc/rc-status.c @@ -331,7 +331,6 @@ int main(int argc, char **argv) exit: free(runlevel); -#ifdef DEBUG_MEMORY rc_stringlist_free(alist); rc_stringlist_free(needsme); rc_stringlist_free(sservices); @@ -340,7 +339,6 @@ exit: rc_stringlist_free(types); rc_stringlist_free(levels); rc_deptree_free(deptree); -#endif return retval; } diff --git a/src/rc/rc.c b/src/rc/rc.c index ed06bf76..45f57b3e 100644 --- a/src/rc/rc.c +++ b/src/rc/rc.c @@ -86,6 +86,12 @@ const char *usagestring = "" \ #define DEVBOOT "/dev/.rcboot" const char *applet = NULL; +static RC_STRINGLIST *hotplugged_services; +static RC_STRINGLIST *stop_services; +static RC_STRINGLIST *start_services; +static RC_STRINGLIST *types_nw; +static RC_STRINGLIST *types_nwua; +static RC_DEPTREE *deptree; static char *runlevel; static RC_HOOK hook_out; @@ -127,10 +133,8 @@ clean_failed(void) static void cleanup(void) { -#ifdef DEBUG_MEMORY RC_PID *p1 = LIST_FIRST(&service_pids); RC_PID *p2; -#endif if (!rc_in_logger && !rc_in_plugin && applet && (strcmp(applet, "rc") == 0 || strcmp(applet, "openrc") == 0)) @@ -152,7 +156,6 @@ cleanup(void) rc_logger_close(); } -#ifdef DEBUG_MEMORY while (p1) { p2 = LIST_NEXT(p1, entries); free(p1); @@ -166,7 +169,6 @@ cleanup(void) rc_stringlist_free(types_nwua); rc_deptree_free(deptree); free(runlevel); -#endif } static char @@ -735,12 +737,6 @@ int main(int argc, char **argv) const char *bootlevel = NULL; char *newlevel = NULL; const char *systype = NULL; - static RC_STRINGLIST *hotplugged_services; - static RC_STRINGLIST *stop_services; - static RC_STRINGLIST *start_services; - static RC_STRINGLIST *types_nw; - static RC_STRINGLIST *types_nwua; - static RC_DEPTREE *deptree; RC_STRINGLIST *deporder = NULL; RC_STRINGLIST *tmplist; RC_STRING *service; diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index 8ed3e923..27939c2c 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -177,7 +177,6 @@ free_schedulelist(void) TAILQ_INIT(&schedule); } -#ifdef DEBUG_MEMORY static void cleanup(void) { @@ -185,7 +184,6 @@ cleanup(void) free(nav); free_schedulelist(); } -#endif static int parse_signal(const char *sig) @@ -688,9 +686,7 @@ int main(int argc, char **argv) applet = basename_c(argv[0]); TAILQ_INIT(&schedule); -#ifdef DEBUG_MEMORY atexit(cleanup); -#endif signal_setup(SIGINT, handle_signal); signal_setup(SIGQUIT, handle_signal); |