]> err.no Git - systemd/commitdiff
socket: fix bitfields in fd watches
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Apr 2010 20:11:13 +0000 (22:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Apr 2010 20:11:13 +0000 (22:11 +0200)
manager.h
socket.c

index a6c330ae21ceb57853b735716dd1d9058034b0ae..3790cfd281750ce15739c9358c2eeeebf2d7143f 100644 (file)
--- a/manager.h
+++ b/manager.h
@@ -71,9 +71,9 @@ struct Watch {
                 union Unit *unit;
                 DBusWatch *bus_watch;
                 DBusTimeout *bus_timeout;
-                bool socket_accept;
         } data;
-        bool fd_is_dupped;
+        bool fd_is_dupped:1;
+        bool socket_accept:1;
 };
 
 #include "unit.h"
index b517344e70ab19b52efb9a47677921c553373eab..cb065b75bfeca5af7f7d31b2b34e6d403f9846f1 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -453,7 +453,7 @@ static int socket_watch_fds(Socket *s) {
                 if (p->fd < 0)
                         continue;
 
-                p->fd_watch.data.socket_accept =
+                p->fd_watch.socket_accept =
                         s->accept &&
                         p->type == SOCKET_SOCKET &&
                         socket_address_can_accept(&p->address);
@@ -1094,7 +1094,7 @@ static void socket_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
                 goto fail;
         }
 
-        if (w->data.socket_accept) {
+        if (w->socket_accept) {
                 for (;;) {
 
                         if ((cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK)) < 0) {