[PATCH wayland v2 1/5] server: Add new api for add socket for fd

Pekka Paalanen ppaalanen at gmail.com
Wed Dec 2 02:15:19 PST 2015


On Wed, 2 Dec 2015 10:51:21 +0200
Pekka Paalanen <ppaalanen at gmail.com> wrote:

> Hi,
> 
> I don't really understand the underlying use case, but I can imagine
> adding listening sockects to wl_display by fd being useful, so I have
> no objections to this feature in general.
> 
> More below.
> 
> 
> On Mon, 23 Nov 2015 19:59:19 -0800
> Bryce Harrington <bryce at osg.samsung.com> wrote:
> 
> > From: Sangjin Lee <lsj119 at samsung.com>
> > 
> > Currently the server can add a socket by name.  To support an embedded
> > compositor in a Simplified Mandatory Access Control Kernel (Smack)
> > enabled environment, the embedded compositor should use the socket that
> > it gets from the system or session compositor.
> > 
> > Signed-off-by: Sangjin Lee <lsj119 at samsung.com>
> > Acked-by: Sung-Jin Park <sj76.park at samsung.com>
> > Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
> > Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
> > ---
> >  src/wayland-os.c          | 12 ++++++++
> >  src/wayland-os.h          |  2 ++
> >  src/wayland-server-core.h |  6 ++++
> >  src/wayland-server.c      | 76 ++++++++++++++++++++++++++++++-----------------
> >  4 files changed, 68 insertions(+), 28 deletions(-)
> > 

> > --- a/src/wayland-server-core.h
> > +++ b/src/wayland-server-core.h
> > @@ -128,9 +128,15 @@ wl_display_get_event_loop(struct wl_display *display);
> >  int
> >  wl_display_add_socket(struct wl_display *display, const char *name);
> >  
> > +int
> > +wl_display_add_socket_fd(struct wl_display *display, const char *name, int sock_fd);
> > +
> >  const char *
> >  wl_display_add_socket_auto(struct wl_display *display);
> >  
> > +const char *
> > +wl_display_add_socket_fd_auto(struct wl_display *display, int sock_fd);  
> 
> These two API additions are strange, more of them below.
> 
> IMHO much better would be to add just one:
> 
> int
> wl_display_add_socket_fd(struct wl_display *display, int sock_fd);
> 
> which will simply fail if sock_fd is not open and valid.
> 

> 
> I think the new public API could be better, so NAK.

To be clear, if you fix the public API and the wayland-os part, this
would have good chances of getting accepted.

The API as proposed is a no-go for me without thorough explanation of
why you would need it the way you wrote it.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151202/13bd9001/attachment-0001.sig>


More information about the wayland-devel mailing list