On Sun, Aug 31, 2014 at 10:46:50PM +0200, Alexander Bluhm wrote:
> Move the handlers for the poll events into separate functions.  They
> will become the libevent callbacks later.
...

> @@ -631,23 +606,65 @@ main(int argc, char *argv[])
>  
>               for (i = 0; i < nfunix; i++) {
>                       if ((pfd[PFD_UNIX_0 + i].revents & POLLIN) != 0) {
> -                             ssize_t rlen;
> -
> -                             len = sizeof(fromunix);
> -                             rlen = recvfrom(pfd[PFD_UNIX_0 + i].fd, line,
> -                                 MAXLINE, 0, (struct sockaddr *)&fromunix,
> -                                 &len);
> -                             if (rlen > 0) {
> -                                     line[rlen] = '\0';
> -                                     printline(LocalHostName, line);
> -                             } else if (rlen == -1 && errno != EINTR)
> -                                     logerror("recvfrom unix");
> +                             udp_read_handler(pfd[PFD_UNIX_0 + i].fd);
...

Shouldn't this be a call to unix_read_handler() instead of
udp_read_handler()?

Reply via email to