chiark / gitweb /
systemadm; fix alignment of labels
[elogind.git] / socket.c
index b517344e70ab19b52efb9a47677921c553373eab..755bc598da7e035b3a278525b543e717ff4caec4 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);
@@ -667,7 +667,7 @@ static void socket_enter_signal(Socket *s, SocketState state, bool success) {
                         }
         }
 
-        if (sent) {
+        if (sent && s->control_pid > 0) {
                 if ((r = unit_watch_timer(UNIT(s), s->timeout_usec, &s->timer_watch)) < 0)
                         goto fail;
 
@@ -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) {
@@ -1110,7 +1110,6 @@ static void socket_fd_event(Unit *u, int fd, uint32_t events, Watch *w) {
                 }
         }
 
-        log_debug("cfd=%i", cfd);
         socket_enter_running(s, cfd);
         return;