chiark / gitweb /
sd-dhcp-server: check if r < 0
[elogind.git] / src / libsystemd-network / network-internal.c
index 3407537eb5824620ecf69b2c33ee51da2e945a44..7f744215cc14569f7c238fd37c27efe6c8ae79d8 100644 (file)
@@ -339,27 +339,22 @@ int net_parse_inaddr(const char *address, int *family, void *dst) {
         return 0;
 }
 
-void serialize_in_addrs(FILE *f, const char *key, const struct in_addr *addresses, size_t size) {
+void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) {
         unsigned i;
 
         assert(f);
-        assert(key);
         assert(addresses);
         assert(size);
 
-        fprintf(f, "%s=", key);
-
         for (i = 0; i < size; i++)
                 fprintf(f, "%s%s", inet_ntoa(addresses[i]),
                         (i < (size - 1)) ? " ": "");
-
-        fputs("\n", f);
 }
 
 int deserialize_in_addrs(struct in_addr **ret, const char *string) {
         _cleanup_free_ struct in_addr *addresses = NULL;
         int size = 0;
-        char *word, *state;
+        const char *word, *state;
         size_t len;
 
         assert(ret);
@@ -396,7 +391,7 @@ int deserialize_in_addrs(struct in_addr **ret, const char *string) {
 int deserialize_in6_addrs(struct in6_addr **ret, const char *string) {
         _cleanup_free_ struct in6_addr *addresses = NULL;
         int size = 0;
-        char *word, *state;
+        const char *word, *state;
         size_t len;
 
         assert(ret);
@@ -451,7 +446,7 @@ void serialize_dhcp_routes(FILE *f, const char *key, struct sd_dhcp_route *route
 int deserialize_dhcp_routes(struct sd_dhcp_route **ret, size_t *ret_size, size_t *ret_allocated, const char *string) {
         _cleanup_free_ struct sd_dhcp_route *routes = NULL;
         size_t size = 0, allocated = 0;
-        char *word, *state;
+        const char *word, *state;
         size_t len;
 
         assert(ret);