chiark / gitweb /
add test for garbage collector
[elogind.git] / load-fragment.c
index 05a7114b4493f05466956220d785d0cadbf8098b..ed046d0356e5628e795cf79347f5d05c0e79466c 100644 (file)
@@ -8,6 +8,7 @@
 #include "strv.h"
 #include "conf-parser.h"
 #include "load-fragment.h"
+#include "log.h"
 
 static int config_parse_deps(
                 const char *filename,
@@ -93,7 +94,7 @@ static int config_parse_names(
                                         return -EEXIST;
                                 }
 
-                                if ((r = name_merge(name, other) < 0)) {
+                                if ((r = name_merge(name, other)) < 0) {
                                         free(t);
                                         return r;
                                 }
@@ -130,12 +131,19 @@ static int config_parse_listen(
                 void *data,
                 void *userdata) {
 
+        int r;
+
         assert(filename);
         assert(lvalue);
         assert(rvalue);
         assert(data);
 
-        return address_parse(data, rvalue);
+        if ((r = address_parse(data, rvalue)) < 0) {
+                log_error("[%s:%u] Failed to parse address value: %s", filename, line, rvalue);
+                return r;
+        }
+
+        return 0;
 }
 
 static int config_parse_type(
@@ -158,8 +166,10 @@ static int config_parse_type(
                 *type = SOCK_STREAM;
         else if (streq(rvalue, "dgram"))
                 *type = SOCK_DGRAM;
-        else
+        else {
+                log_error("[%s:%u] Failed to parse socket type value: %s", filename, line, rvalue);
                 return -EINVAL;
+        }
 
         return 0;
 }