chiark / gitweb /
resolved: make use of union in_addr_union in resolved, too
authorLennart Poettering <lennart@poettering.net>
Mon, 7 Jul 2014 21:11:48 +0000 (23:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 7 Jul 2014 21:11:48 +0000 (23:11 +0200)
src/resolve/resolved-manager.c
src/resolve/resolved.h
src/timesync/timesyncd.c

index 0e2b85b..9d073c7 100644 (file)
@@ -114,6 +114,8 @@ int manager_new(Manager **ret) {
         _cleanup_manager_free_ Manager *m = NULL;
         int r;
 
+        assert(ret);
+
         m = new0(Manager, 1);
         if (!m)
                 return -ENOMEM;
index 984edc7..48b361d 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "util.h"
 #include "list.h"
+#include "socket-util.h"
 
 typedef struct Address Address;
 typedef struct Manager Manager;
@@ -33,10 +34,7 @@ typedef struct Manager Manager;
 struct Address {
         unsigned char family;
 
-        union {
-                struct in_addr in;
-                struct in6_addr in6;
-        } in_addr;
+        union in_addr_union in_addr;
 
         LIST_FIELDS(Address, addresses);
 };
index 27f6b2d..0c50902 100644 (file)
@@ -1019,6 +1019,8 @@ static int manager_new(Manager **ret) {
         _cleanup_manager_free_ Manager *m = NULL;
         int r;
 
+        assert(ret);
+
         m = new0(Manager, 1);
         if (!m)
                 return -ENOMEM;