socket: don't call accept() on FIFOs ever

This commit is contained in:
Lennart Poettering 2010-04-23 21:56:38 +02:00
parent 2608882fe5
commit dd5ad9d4e6

View file

@ -119,9 +119,14 @@ static bool have_non_accept_socket(Socket *s) {
if (!s->accept) if (!s->accept)
return true; return true;
LIST_FOREACH(port, p, s->ports) LIST_FOREACH(port, p, s->ports) {
if (p->type != SOCKET_SOCKET)
return true;
if (!socket_address_can_accept(&p->address)) if (!socket_address_can_accept(&p->address))
return true; return true;
}
return false; return false;
} }
@ -450,6 +455,7 @@ static int socket_watch_fds(Socket *s) {
p->fd_watch.data.socket_accept = p->fd_watch.data.socket_accept =
s->accept && s->accept &&
p->type == SOCKET_SOCKET &&
socket_address_can_accept(&p->address); socket_address_can_accept(&p->address);
if ((r = unit_watch_fd(UNIT(s), p->fd, EPOLLIN, &p->fd_watch)) < 0) if ((r = unit_watch_fd(UNIT(s), p->fd, EPOLLIN, &p->fd_watch)) < 0)