summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-12-18 12:33:05 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-12-18 19:26:21 -0500
commit447021aafdf4bd0c0f70a3078d35a8f00ada4504 (patch)
tree3a0ac085595cc6d95dab2421efd0be80f27d9ad5
parentf1acf85a36f4c32d69511fe1bfa12f66e28fa80d (diff)
tree-wide: make condition_free_list return NULL
-rw-r--r--src/core/load-fragment.c9
-rw-r--r--src/shared/condition.c4
-rw-r--r--src/shared/condition.h2
3 files changed, 7 insertions, 8 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index e8dfa1a511..7430036f48 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2042,8 +2042,7 @@ int config_parse_unit_condition_path(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
- condition_free_list(*list);
- *list = NULL;
+ *list = condition_free_list(*list);
return 0;
}
@@ -2100,8 +2099,7 @@ int config_parse_unit_condition_string(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
- condition_free_list(*list);
- *list = NULL;
+ *list = condition_free_list(*list);
return 0;
}
@@ -2150,8 +2148,7 @@ int config_parse_unit_condition_null(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
- condition_free_list(*list);
- *list = NULL;
+ *list = condition_free_list(*list);
return 0;
}
diff --git a/src/shared/condition.c b/src/shared/condition.c
index dcbf9a7e86..3a3452959d 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -73,11 +73,13 @@ void condition_free(Condition *c) {
free(c);
}
-void condition_free_list(Condition *first) {
+Condition* condition_free_list(Condition *first) {
Condition *c, *n;
LIST_FOREACH_SAFE(conditions, c, n, first)
condition_free(c);
+
+ return NULL;
}
static int condition_test_kernel_command_line(Condition *c) {
diff --git a/src/shared/condition.h b/src/shared/condition.h
index 28d1d94ff4..0780e78123 100644
--- a/src/shared/condition.h
+++ b/src/shared/condition.h
@@ -79,7 +79,7 @@ typedef struct Condition {
Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate);
void condition_free(Condition *c);
-void condition_free_list(Condition *c);
+Condition* condition_free_list(Condition *c);
int condition_test(Condition *c);