From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A859F138306 for ; Thu, 14 Jul 2016 22:04:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5036EE0B3F; Thu, 14 Jul 2016 22:04:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D9DC7E0B3F for ; Thu, 14 Jul 2016 22:04:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CDD28340B30 for ; Thu, 14 Jul 2016 22:04:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 057F5244B for ; Thu, 14 Jul 2016 22:04:15 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1468533177.3a1262703fd20d2e8288d13d908fb282c77d1793.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/, src/rc/, / X-VCS-Repository: proj/openrc X-VCS-Files: README.md src/librc/librc-misc.c src/rc/openrc-run.c src/rc/rc-misc.c src/rc/rc-service.c src/rc/rc-status.c src/rc/rc.c src/rc/start-stop-daemon.c X-VCS-Directories: / src/rc/ src/librc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 3a1262703fd20d2e8288d13d908fb282c77d1793 X-VCS-Branch: master Date: Thu, 14 Jul 2016 22:04:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 45319a99-67d7-4b32-9788-2938007f6b63 X-Archives-Hash: 57c00ebb257bd86041e6dfb49728f0c5 commit: 3a1262703fd20d2e8288d13d908fb282c77d1793 Author: William Hubbs gmail com> AuthorDate: Sun Mar 22 20:04:14 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Jul 14 21:52:57 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=3a126270 Remove the DEBUG_MEMORY macro This fixes #43. README.md | 3 --- src/librc/librc-misc.c | 18 ++++++------------ src/rc/openrc-run.c | 4 ---- src/rc/rc-misc.c | 2 -- src/rc/rc-service.c | 6 ------ src/rc/rc-status.c | 2 -- src/rc/rc.c | 16 ++++++---------- src/rc/start-stop-daemon.c | 4 ---- 8 files changed, 12 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 7fadd23..edf6426 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,6 @@ We don't support building a static OpenRC with PAM. You may need to use `PROGLDFLAGS=-Wl,-Bstatic` on glibc instead of just `-static`. -If you debug memory under valgrind, add `-DDEBUG_MEMORY` -to your `CPPFLAGS` so that all malloc memory should be freed at exit. - If you are building OpenRC for a Gentoo Prefix installation, add `MKPREFIX=yes`. `PKG_PREFIX` should be set to where packages install to by default. diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c index d558941..45bdb7a 100644 --- a/src/librc/librc-misc.c +++ b/src/librc/librc-misc.c @@ -404,6 +404,12 @@ librc_hidden_def(rc_config_value) * each rc_conf_value call */ static RC_STRINGLIST *rc_conf = NULL; +static void +_free_rc_conf(void) +{ + rc_stringlist_free(rc_conf); +} + char * rc_conf_value(const char *setting) { @@ -413,17 +419,13 @@ rc_conf_value(const char *setting) if (! rc_conf) { rc_conf = rc_config_load(RC_CONF); -#ifdef DEBUG_MEMORY atexit(_free_rc_conf); -#endif /* Support old configs. */ if (exists(RC_CONF_OLD)) { old = rc_config_load(RC_CONF_OLD); TAILQ_CONCAT(rc_conf, old, entries); -#ifdef DEBUG_MEMORY free(old); -#endif } rc_conf = rc_config_directory(rc_conf); @@ -443,11 +445,3 @@ rc_conf_value(const char *setting) return rc_config_value(rc_conf, setting); } librc_hidden_def(rc_conf_value) - -#ifdef DEBUG_MEMORY -static void -_free_rc_conf(void) -{ - rc_stringlist_free(rc_conf); -} -#endif diff --git a/src/rc/openrc-run.c b/src/rc/openrc-run.c index 275cb32..ff884c4 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 82f1b78..85a0db7 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 3fd94b2..d0a6499 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 a0a2fce..6724db8 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 ed06bf7..45f57b3 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 8ed3e92..27939c2 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);