chiark / gitweb /
tree-wide: make condition_free_list return NULL
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 Dec 2014 17:33:05 +0000 (12:33 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Dec 2014 00:26:21 +0000 (19:26 -0500)
src/core/load-fragment.c
src/shared/condition.c
src/shared/condition.h

index e8dfa1a5119b7949aff14080a6b50a9c0dfd9c93..7430036f481f15265be8d8929c526091349ce214 100644 (file)
@@ -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;
         }
 
index dcbf9a7e86a52f2ef089339550b6da4f02eba41f..3a3452959dd726010dc4ab91f9afede58fd57d43 100644 (file)
@@ -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) {
index 28d1d94ff477420b2af94be627db92d5eef5d136..0780e78123ab6d2628120482a48f6ef9c67ae9be 100644 (file)
@@ -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);