[PATCH 2/3] server: Implement an interface change notification object (rebased).
Alexandre Julliard
julliard at winehq.org
Wed Dec 4 09:14:37 CST 2013
"Erich E. Hoover" <erich.e.hoover at gmail.com> writes:
> +static void ifchange_poll_event( struct fd *fd, int event )
> +{
> + struct object *ifchange = get_fd_user( fd );
> + int r, unix_fd, wakeup = FALSE;
> + char buffer[0x1000];
> +
> + unix_fd = get_unix_fd( fd );
> + r = recv( unix_fd, buffer, sizeof(buffer), 0 );
> + if (r < 0)
> + {
> + fprintf(stderr,"ifchange_poll_event(): ifchange read failed!\n");
> + return;
> + }
> + else if (r != 0)
> + {
> +#if defined(NETLINK_ROUTE)
> + struct nlmsghdr *nlh;
> +
> + nlh = (struct nlmsghdr*) buffer;
> + if (NLMSG_OK(nlh, r) && (nlh->nlmsg_type == RTM_NEWADDR || nlh->nlmsg_type == RTM_DELADDR))
> + wakeup = TRUE;
> +#endif
> + }
> + if (wakeup)
> + ifchange_wake_up( ifchange, STATUS_SUCCESS );
> +}
This needs more work. Also please try to better follow wineserver
conventions everywhere.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list