[systemd-devel] [PATCH] socket.c: make use of union sockaddr_union

Daniel Buch boogiewasthere at gmail.com
Wed Mar 12 12:09:25 PDT 2014


---
 src/core/socket.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/core/socket.c b/src/core/socket.c
index 35531ed..8ecc9f9 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -597,13 +597,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
 static int instance_from_socket(int fd, unsigned nr, char **instance) {
         socklen_t l;
         char *r;
-        union {
-                struct sockaddr sa;
-                struct sockaddr_un un;
-                struct sockaddr_in in;
-                struct sockaddr_in6 in6;
-                struct sockaddr_storage storage;
-        } local, remote;
+        union sockaddr_union local, remote;
 
         assert(fd >= 0);
         assert(instance);
-- 
1.9.0



More information about the systemd-devel mailing list