mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-27 01:55:32 +03:00
socket: fix bitfields in fd watches
This commit is contained in:
parent
dd5ad9d4e6
commit
cabab516b3
@ -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"
|
||||
|
4
socket.c
4
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user