On Thu, Oct 11, 2012 at 11:37 PM, David Herrmann <[email protected]> wrote: > We need our own copy of the file-descriptor in each wl_display so we can > close() it on error to wake up the main-thread. > > Signed-off-by: David Herrmann <[email protected]> > ---
Pekka and I discussed this on IRC and we came to the conclusion that it is easier if we change semantics here. Calling wl_display_connect_to_fd() should pass ownership of the FD to wl_display. So if the user wants to keep the FD, they have to dup() it before passing it to wl_display_connect_to_fd(). This would make the dup() call inside of wl_display unneeded and we can simply always call close(). Furthermore, we couldn't think of any reason why the user would want to keep an FD around, anyway. So if we use wl_display_connect_to_fd() we would call close() on the FD afterwards, because we don't need the copy. If we pass FD ownership to wl_display, we can avoid all that without making the API less powerful. If nobody objects, I will fix this in the next revision. Regards David _______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
