chiark / gitweb /
manager: reuse sockaddr_union instead of redefining our own version of it
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Aug 2014 14:51:44 +0000 (16:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 21 Aug 2014 15:24:21 +0000 (17:24 +0200)
src/core/manager.c

index 445461b6b9ac9341e27e50b5eee212e668b70f32..e488aba5f8be8a5cbc5cc8755a8df447bf23921d 100644 (file)
@@ -527,13 +527,10 @@ static int manager_setup_notify(Manager *m) {
 
         if (m->notify_fd < 0) {
                 _cleanup_close_ int fd = -1;
 
         if (m->notify_fd < 0) {
                 _cleanup_close_ int fd = -1;
-                union {
-                        struct sockaddr sa;
-                        struct sockaddr_un un;
-                } sa = {
+                union sockaddr_union sa =  {
                         .sa.sa_family = AF_UNIX,
                 };
                         .sa.sa_family = AF_UNIX,
                 };
-                int one = 1;
+                static const int one = 1;
 
                 /* First free all secondary fields */
                 free(m->notify_socket);
 
                 /* First free all secondary fields */
                 free(m->notify_socket);