<HTML><HEAD><TITLE>Samsung Enterprise Portal mySingle</TITLE>
<META content="text/html; charset=euc-kr" http-equiv=Content-Type>
<STYLE id=mysingle_style type=text/css>P {
MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN-TOP: 5px
}
TD {
MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN-TOP: 5px
}
LI {
MARGIN-BOTTOM: 5px; FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN-TOP: 5px
}
BODY {
FONT-SIZE: 9pt; FONT-FAMILY: ±¼¸²Ã¼, arial; MARGIN: 10px; LINE-HEIGHT: 1.4
}
</STYLE>
<META content=IE=5 http-equiv=X-UA-Compatible>
<META content=IE=5 http-equiv=X-UA-Compatible>
<META name=GENERATOR content="MSHTML 11.00.9600.18098"></HEAD>
<BODY>
<P>I don't see any reason for the wl_display_add_socket_fd_auto and wl_display_add_socket_auto functions, as they are the same as passing NULL for the name to wl_display_add_socket_fd, right?<BR>==> No, The wl_display_add_socket_fd_auto is different action to wl_display_add_socket_fd with NULL name.</P>
<P>The wl_display_add_socket_fd_auto() is change display name(wayland-%d) until find success.<BR></P>
<DIV dir=ltr>Also (on the patch) it looks like if there is an error it destroys the wl_socket object, could this do the wrong thing if the fd was supplied from outside?<BR></DIV>
<DIV class=gmail_extra><BR>
<DIV class=gmail_quote>On Thu, Nov 19, 2015 at 1:36 AM, Bryce Harrington <SPAN dir=ltr><<A href="mailto:bryce@osg.samsung.com" target=_blank>bryce@osg.samsung.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Signed-off-by: Bryce Harrington <<A href="mailto:bryce@osg.samsung.com">bryce@osg.samsung.com</A>><BR>---<BR> src/wayland-server.c | 67 +++++++++++++++++++++++++++++++++++++++++-----------<BR> 1 file changed, 53 insertions(+), 14 deletions(-)<BR><BR>diff --git a/src/wayland-server.c b/src/wayland-server.c<BR>index bac98bf..e84858d 100644<BR>--- a/src/wayland-server.c<BR>+++ b/src/wayland-server.c<BR>@@ -1164,6 +1164,17 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s)<BR> return 0;<BR> }<BR><BR>+/** Create a socket for clients with a specified file descriptor<BR>+ * \param display Wayland display<BR>+ * \param sock_fd The socket's file descriptor<BR>+ * \return The socket name or NULL if failed.<BR>+ *<BR>+ * Adds a new socket with a specified file descriptor but an<BR>+ * automatically determined socket name, in the form "wayland-N"<BR>+ * where N is a display number.<BR>+ *<BR>+ * \memberof wl_display<BR>+ */<BR> WL_EXPORT const char *<BR> wl_display_add_socket_fd_auto(struct wl_display *display, int sock_fd)<BR> {<BR>@@ -1205,12 +1216,50 @@ wl_display_add_socket_fd_auto(struct wl_display *display, int sock_fd)<BR> return NULL;<BR> }<BR><BR>+/** Create a socket for clients using default settings<BR>+ * \param display The Wayland display to which the socket should be added<BR>+ * \return The name of the created socket, or NULL if failed.<BR>+ *<BR>+ * This helper routine establishes a socket connection for Wayland clients<BR>+ * using an automatically socket address and file descriptor.<BR>+ *<BR>+ * See wl_display_add_socket_fd_auto.<BR>+ *<BR>+ * \memberof wl_display<BR>+ */<BR> WL_EXPORT const char *<BR> wl_display_add_socket_auto(struct wl_display *display)<BR> {<BR> return wl_display_add_socket_fd_auto(display, -1);<BR> }<BR><BR>+/** Add a socket with a defined file descriptor to the Wayland display for clients to connect.<BR>+ * \param display Wayland display to which the socket should be added.<BR>+ * \param name Name of the Unix socket.<BR>+ * \param sock_fd File descriptor of the Unix socket.<BR>+ * \return 0 if success. -1 if failed.<BR>+ *<BR>+ * This adds a Unix socket to Wayland display which can be used by clients to<BR>+ * connect to Wayland display.<BR>+ *<BR>+ * If NULL is passed as name, then it would look for WAYLAND_DISPLAY env<BR>+ * variable for the socket name. If WAYLAND_DISPLAY is not set, then default<BR>+ * wayland-0 is used.<BR>+ *<BR>+ * If -1 is passed for sock_id, a new local socket will be created. A link to<BR>+ * this socket will be made available in display->socket_list.<BR>+ *<BR>+ * This Unix socket will be created in the directory pointed to by environment<BR>+ * variable XDG_RUNTIME_DIR. If XDG_RUNTIME_DIR is not set, then this function<BR>+ * fails and returns -1.<BR>+ *<BR>+ * The length of socket path, i.e., the path set in XDG_RUNTIME_DIR and the<BR>+ * socket name, must not exceed the maxium length of a Unix socket path.<BR>+ * The function also fails if the user do not have write permission in the<BR>+ * XDG_RUNTIME_DIR path or if the socket name is already in use.<BR>+ *<BR>+ * \memberof wl_display<BR>+ */<BR> WL_EXPORT int<BR> wl_display_add_socket_fd(struct wl_display *display, const char *name, int sock_fd)<BR> {<BR>@@ -1251,21 +1300,11 @@ wl_display_add_socket_fd(struct wl_display *display, const char *name, int sock_<BR> * \param name Name of the Unix socket.<BR> * \return 0 if success. -1 if failed.<BR> *<BR>- * This adds a Unix socket to Wayland display which can be used by clients to<BR>- * connect to Wayland display.<BR>- *<BR>- * If NULL is passed as name, then it would look for WAYLAND_DISPLAY env<BR>- * variable for the socket name. If WAYLAND_DISPLAY is not set, then default<BR>- * wayland-0 is used.<BR>+ * This adds a Unix socket to Wayland display with an automatically<BR>+ * created file descriptor, which can be used by clients to connect to<BR>+ * the Wayland display.<BR> *<BR>- * The Unix socket will be created in the directory pointed to by environment<BR>- * variable XDG_RUNTIME_DIR. If XDG_RUNTIME_DIR is not set, then this function<BR>- * fails and returns -1.<BR>- *<BR>- * The length of socket path, i.e., the path set in XDG_RUNTIME_DIR and the<BR>- * socket name, must not exceed the maxium length of a Unix socket path.<BR>- * The function also fails if the user do not have write permission in the<BR>- * XDG_RUNTIME_DIR path or if the socket name is already in use.<BR>+ * See wl_display_add_socket_fd for more details.<BR> *<BR> * \memberof wl_display<BR> */<BR><SPAN class=HOEnZb><FONT color=#888888>--<BR>1.9.1<BR><BR>_______________________________________________<BR>wayland-devel mailing list<BR><A href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</A><BR><A href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel=noreferrer target=_blank>http://lists.freedesktop.org/mailman/listinfo/wayland-devel</A><BR></FONT></SPAN></BLOCKQUOTE></DIV><BR></DIV>
<TABLE id=confidentialsignimg>
<TBODY>
<TR>
<TD NAMO_LOCK>
<P><IMG border=0 src="cid:Z5JE7EUABGFC@namo.co.kr"></P></TD></TR></TBODY></TABLE></BODY></HTML><img src='http://ext.samsung.net/mailcheck/SeenTimeChecker?do=d1c4c6a24968fb25fbd3e29d1d5649074b93bddc36eef38cd261643f4e17952232c2d5b092db2212f255f74e40bd48632fd4ff3ea410d012fea75954dce1604da728c55b39cc59eacf878f9a26ce15a0' border=0 width=0 height=0 style='display:none'>