[PATCH] doc: Added API documentation for wl_display_destroy and wl_display_add_socket functions.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c | 20 1 file changed, 20 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 674aeca..0f61e6e 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -862,6 +862,15 @@ wl_socket_alloc(void) return s; } +/** Destroy Wayland display object. + * + * \param display The Wayland display object which should be destroyed. + * \return None. + * + * This destroys the wl_display object which has been passed. + * + * \memberof wl_display + */ WL_EXPORT void wl_display_destroy(struct wl_display *display) { @@ -1181,6 +1190,17 @@ wl_display_add_socket_auto(struct wl_display *display) return NULL; } +/** Add a socket to Wayland display for the clients to connect. + * + * \param display Wayland display to which the socket should be added. + * \param name Name of the Unix socket. + * \return 0 if success. -1 if failed. + * + * This adds a Unix socket to Wayland display which can be used by clients to + * connect to Wayland display. + * + * \memberof wl_display + */ WL_EXPORT int wl_display_add_socket(struct wl_display *display, const char *name) { -- 2.1.0 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH V3] doc: Added API documentation for wl_display_destroy and wl_display_add_socket functions.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c | 33 + 1 file changed, 33 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 674aeca..469127f 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -862,6 +862,18 @@ wl_socket_alloc(void) return s; } +/** Destroy Wayland display object. + * + * \param display The Wayland display object which should be destroyed. + * \return None. + * + * This function sends a destroy signal to all registered clients, releases + * all the sockets added to this display, free's all the globals associated + * with this display, free's memory of additional shared memory formats and + * destory the display object. + * + * \memberof wl_display + */ WL_EXPORT void wl_display_destroy(struct wl_display *display) { @@ -1181,6 +1193,27 @@ wl_display_add_socket_auto(struct wl_display *display) return NULL; } +/** Add a socket to Wayland display for the clients to connect. + * + * \param display Wayland display to which the socket should be added. + * \param name Name of the Unix socket. + * \return 0 if success. -1 if failed. + * + * This adds a Unix socket to Wayland display which can be used by clients to + * connect to Wayland display. + * If NULL is passed as name, then it would look for WAYLAND_DISPLAY env + * variable for the socket name. If WAYLAND_DISPLAY is not set, then default + * wayland-0 is used. + * The Unix socket would be created in the path which is set in env + * variable XDG_RUNTIME_DIR. If XDG_RUNTIME_DIR is not set, then this function + * fails and returns -1. + * The length of socket path, i.e., the path set in XDG_RUNTIME_DIR and the + * socket name should not exceed 108 characters. Else this would fail. + * The function also fails if the user do not have write permission in the + * XDG_RUNTIME_DIR path or if the socket name is already in use. + * + * \memberof wl_display + */ WL_EXPORT int wl_display_add_socket(struct wl_display *display, const char *name) { -- 2.1.0 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH V4] doc: Added API documentation for wl_display_destroy and wl_display_add_socket functions.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c | 33 + 1 file changed, 33 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 674aeca..0fc2088 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -862,6 +862,18 @@ wl_socket_alloc(void) return s; } +/** Destroy Wayland display object. + * + * \param display The Wayland display object which should be destroyed. + * \return None. + * + * This function sends a destroy signal to all registered clients, releases + * all the sockets added to this display, free's all the globals associated + * with this display, free's memory of additional shared memory formats and + * destroy the display object. + * + * \memberof wl_display + */ WL_EXPORT void wl_display_destroy(struct wl_display *display) { @@ -1181,6 +1193,27 @@ wl_display_add_socket_auto(struct wl_display *display) return NULL; } +/** Add a socket to Wayland display for the clients to connect. + * + * \param display Wayland display to which the socket should be added. + * \param name Name of the Unix socket. + * \return 0 if success. -1 if failed. + * + * This adds a Unix socket to Wayland display which can be used by clients to + * connect to Wayland display. + * If NULL is passed as name, then it would look for WAYLAND_DISPLAY env + * variable for the socket name. If WAYLAND_DISPLAY is not set, then default + * wayland-0 is used. + * The Unix socket would be created in the path which is set in env + * variable XDG_RUNTIME_DIR. If XDG_RUNTIME_DIR is not set, then this function + * fails and returns -1. + * The length of socket path, i.e., the path set in XDG_RUNTIME_DIR and the + * socket name should not exceed 108 characters. Else this would fail. + * The function also fails if the user do not have write permission in the + * XDG_RUNTIME_DIR path or if the socket name is already in use. + * + * \memberof wl_display + */ WL_EXPORT int wl_display_add_socket(struct wl_display *display, const char *name) { -- 2.1.0 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH V2] doc: Added API documentation for wl_display_destroy and wl_display_add_socket functions.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c | 33 + 1 file changed, 33 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 674aeca..4a577f0 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -862,6 +862,18 @@ wl_socket_alloc(void) return s; } +/** Destroy Wayland display object. + * + * \param display The Wayland display object which should be destroyed. + * \return None. + * + * This function sends a destroy signal to all registered clients, releases + * all the sockets added to this display, free's all the globals associated + * with this display, free's memory of additional shared memory formats and + * destory's the display object. + * + * \memberof wl_display + */ WL_EXPORT void wl_display_destroy(struct wl_display *display) { @@ -1181,6 +1193,27 @@ wl_display_add_socket_auto(struct wl_display *display) return NULL; } +/** Add a socket to Wayland display for the clients to connect. + * + * \param display Wayland display to which the socket should be added. + * \param name Name of the Unix socket. + * \return 0 if success. -1 if failed. + * + * This adds a Unix socket to Wayland display which can be used by clients to + * connect to Wayland display. + * If NULL is passed as name, then it would look for WAYLAND_DISPLAY env + * variable for the socket name. If WAYLAND_DISPLAY is not set, then default + * wayland-0 is used. + * The Unix socket would be created in the path which is set in env + * variable XDG_RUNTIME_DIR. If XDG_RUNTIME_DIR is not set, then this function + * fails and returns -1. + * The length of socket path, i.e., the path set in XDG_RUNTIME_DIR and the + * socket name should not exceed 108 characters. Else this would fail. + * The function also fails if the user do not have write permission in the + * XDG_RUNTIME_DIR path or if the socket name is already in use. + * + * \memberof wl_display + */ WL_EXPORT int wl_display_add_socket(struct wl_display *display, const char *name) { -- 2.1.0 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] doc: Added API documentation for wl_display_destroy and wl_display_add_socket functions.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c | 20 1 file changed, 20 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index 674aeca..0f61e6e 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -862,6 +862,15 @@ wl_socket_alloc(void) return s; } +/** Destroy Wayland display object. + * + * \param display The Wayland display object which should be destroyed. + * \return None. + * + * This destroys the wl_display object which has been passed. + * + * \memberof wl_display + */ WL_EXPORT void wl_display_destroy(struct wl_display *display) { @@ -1181,6 +1190,17 @@ wl_display_add_socket_auto(struct wl_display *display) return NULL; } +/** Add a socket to Wayland display for the clients to connect. + * + * \param display Wayland display to which the socket should be added. + * \param name Name of the Unix socket. + * \return 0 if success. -1 if failed. + * + * This adds a Unix socket to Wayland display which can be used by clients to + * connect to Wayland display. + * + * \memberof wl_display + */ WL_EXPORT int wl_display_add_socket(struct wl_display *display, const char *name) { -- 2.1.0 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v2] weston-build: Fix aclocal error during autogen.sh
This is a fix to the following bug: https://bugs.freedesktop.org/show_bug.cgi?id=80214 Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- m4/.gitignore |5 + 1 file changed, 5 insertions(+) create mode 100644 m4/.gitignore diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 000..38066dd --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,5 @@ +libtool.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +lt~obsolete.m4 -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] weston-build: Fix aclocal error during autogen.sh
This is a fix to the following bug: https://bugs.freedesktop.org/show_bug.cgi?id=80214 Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- m4/.gitignore |2 ++ 1 file changed, 2 insertions(+) create mode 100644 m4/.gitignore diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 000..c96a04f --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] doc: Added API documentation for wl_display_create function.
From: Srivardhan Hebbar sri.heb...@samsung.com Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c |9 + 1 file changed, 9 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index f2b1b42..7b32848 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -788,6 +788,15 @@ bind_display(struct wl_client *client, destroy_client_display_resource); } +/** Create Wayland display object. + * + * \param None + * \return The Wayland display object. Null if failed to create + * + * This creates the wl_display object for the client. + * + * \memberof wl_display + */ WL_EXPORT struct wl_display * wl_display_create(void) { -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] doc: Added API documentation for wl_display_create function.
From: Srivardhan Hebbar sri.heb...@samsung.com Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c |9 + 1 file changed, 9 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index f2b1b42..7b32848 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -788,6 +788,15 @@ bind_display(struct wl_client *client, destroy_client_display_resource); } +/** Create Wayland display object. + * + * \param None + * \return The Wayland display object. Null if failed to create + * + * This creates the wl_display object for the client. + * + * \memberof wl_display + */ WL_EXPORT struct wl_display * wl_display_create(void) { -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] weston: Fix memleak issue in compositor.c
This fix is upon Hardening rdp.eff...@gmail.com patch. [PATCH 2/2] Handle OOM with signal events. Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/compositor.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 574db2d..f233101 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -4207,6 +4207,11 @@ int main(int argc, char *argv[]) signals[3] = wl_event_loop_add_signal(loop, SIGCHLD, sigchld_handler, NULL); + if (!signals[0] || !signals[1] || !signals[2] || !signals[3]) { + ret = EXIT_FAILURE; + goto out_signals; + } + if (noconfig == 0) config = weston_config_parse(weston.ini); if (config != NULL) { @@ -4234,13 +4239,16 @@ int main(int argc, char *argv[]) backend_init = weston_load_module(backend, backend_init); free(backend); - if (!backend_init) - exit(EXIT_FAILURE); + if (!backend_init) { + ret = EXIT_FAILURE; + goto out_signals; + } ec = backend_init(display, argc, argv, config); if (ec == NULL) { weston_log(fatal: failed to create compositor\n); - exit(EXIT_FAILURE); + ret = EXIT_FAILURE; + goto out_signals; } catch_signals(); @@ -4321,12 +4329,15 @@ int main(int argc, char *argv[]) wl_signal_emit(ec-destroy_signal, ec); - for (i = ARRAY_LENGTH(signals); i;) - wl_event_source_remove(signals[--i]); - weston_compositor_xkb_destroy(ec); ec-destroy(ec); + +out_signals: + for (i = ARRAY_LENGTH(signals) - 1; i = 0; i--) + if (signals[i]) + wl_event_source_remove(signals[i]); + wl_display_destroy(display); weston_log_file_close(); -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v4] configure.ac: Change in build system to use the path from pkg-config for wayland-scanner.
This is a fix to the bug https://bugs.freedesktop.org/show_bug.cgi?id=78688. Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- Makefile.am |6 +++--- configure.ac | 13 - 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 343adc6..a22fd8d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -997,10 +997,10 @@ CLEANFILES += $(man_MANS) protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml - $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(wayland_scanner) code $ $@ + $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(WAYLAND_SCANNER) code $ $@ protocol/%-server-protocol.h : $(top_srcdir)/protocol/%.xml - $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(wayland_scanner) server-header $ $@ + $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(WAYLAND_SCANNER) server-header $ $@ protocol/%-client-protocol.h : $(top_srcdir)/protocol/%.xml - $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(wayland_scanner) client-header $ $@ + $(AM_V_GEN)$(MKDIR_P) $(dir $@) $(WAYLAND_SCANNER) client-header $ $@ diff --git a/configure.ac b/configure.ac index 031a26f..9cc3907 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,8 @@ AC_ARG_VAR([WESTON_NATIVE_BACKEND], [Set the native backend to use, if Weston is not running under Wayland nor X11. @:@default=drm-backend.so@:@]) AC_ARG_VAR([WESTON_SHELL_CLIENT], [Set the default desktop shell client to load if none is specified in weston.ini. @:@default=weston-desktop-shell@:@]) +AC_ARG_VAR([WAYLAND_SCANNER], + [Set the name of wayland-scanner file with full path. E.g: /usr/bin/wayland-scanner. By default obtain the path from pkg-config]) PKG_PROG_PKG_CONFIG() @@ -498,12 +500,13 @@ if test x$have_lcms = xyes; then fi AM_CONDITIONAL(HAVE_LCMS, [test x$have_lcms = xyes]) -AC_PATH_PROG([wayland_scanner], [wayland-scanner]) -if test x$wayland_scanner = x; then - AC_MSG_ERROR([wayland-scanner is needed to compile weston]) +if test x$WAYLAND_SCANNER = x; then + WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` fi - -PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner) +AC_MSG_CHECKING([for wayland-scanner]) +AS_IF(AS_EXECUTABLE_P([${WAYLAND_SCANNER}]), + [AC_MSG_RESULT([found])],[AC_MSG_RESULT([not found])] + [AC_MSG_ERROR([wayland-scanner is needed to compile weston])]) AC_CONFIG_FILES([Makefile src/version.h src/weston.pc]) -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v3] configure.ac: Change in build system to use the path from pkg-config for wayland-scanner.
This is a fix to the bug https://bugs.freedesktop.org/show_bug.cgi?id=78688. Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- configure.ac | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 031a26f..47a38cd 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,8 @@ AC_ARG_VAR([WESTON_NATIVE_BACKEND], [Set the native backend to use, if Weston is not running under Wayland nor X11. @:@default=drm-backend.so@:@]) AC_ARG_VAR([WESTON_SHELL_CLIENT], [Set the default desktop shell client to load if none is specified in weston.ini. @:@default=weston-desktop-shell@:@]) +AC_ARG_VAR([WAYLAND_SCANNER], + [Set the name of wayland-scanner file with full path. E.g: /usr/bin/wayland-scanner. By default obtain the path from pkg-config]) PKG_PROG_PKG_CONFIG() @@ -498,12 +500,14 @@ if test x$have_lcms = xyes; then fi AM_CONDITIONAL(HAVE_LCMS, [test x$have_lcms = xyes]) -AC_PATH_PROG([wayland_scanner], [wayland-scanner]) -if test x$wayland_scanner = x; then - AC_MSG_ERROR([wayland-scanner is needed to compile weston]) +if test x$WAYLAND_SCANNER = x; then + WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` fi - -PKG_CHECK_MODULES(WAYLAND_SCANNER, wayland-scanner) +AC_MSG_CHECKING([for wayland-scanner]) +AS_IF(AS_EXECUTABLE_P([${WAYLAND_SCANNER}]), + [AC_MSG_RESULT([found])],[AC_MSG_RESULT([not found])] + [AC_MSG_ERROR([wayland-scanner is needed to compile weston])]) +AC_SUBST(wayland_scanner,[${WAYLAND_SCANNER}]) AC_CONFIG_FILES([Makefile src/version.h src/weston.pc]) -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v2] configure.ac: Change in build system to use the path from pkg-config for wayland-scanner.
This is a fix to the bug https://bugs.freedesktop.org/show_bug.cgi?id=78688. Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- configure.ac |9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 031a26f..2a0cf2b 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,8 @@ AC_ARG_VAR([WESTON_NATIVE_BACKEND], [Set the native backend to use, if Weston is not running under Wayland nor X11. @:@default=drm-backend.so@:@]) AC_ARG_VAR([WESTON_SHELL_CLIENT], [Set the default desktop shell client to load if none is specified in weston.ini. @:@default=weston-desktop-shell@:@]) +AC_ARG_VAR([WAYLAND_SCANNER_PATH], + [Set the path of wayland-scanner. By default obtain the path from pkg-config]) PKG_PROG_PKG_CONFIG() @@ -498,7 +500,12 @@ if test x$have_lcms = xyes; then fi AM_CONDITIONAL(HAVE_LCMS, [test x$have_lcms = xyes]) -AC_PATH_PROG([wayland_scanner], [wayland-scanner]) +if test x$WAYLAND_SCANNER_PATH = x; then + WAYLAND_SCANNER_PATH=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner` + WAYLAND_SCANNER_PATH=`AS_DIRNAME($WAYLAND_SCANNER_PATH)` +fi +AC_PATH_PROG([wayland_scanner], [wayland-scanner],, + [${WAYLAND_SCANNER_PATH}]) if test x$wayland_scanner = x; then AC_MSG_ERROR([wayland-scanner is needed to compile weston]) fi -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] configure.ac: Change in build system to use the path from pkg-config for wayland-scanner.
This is a fix to the bug https://bugs.freedesktop.org/show_bug.cgi?id=78688. Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- configure.ac |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 031a26f..89965e2 100644 --- a/configure.ac +++ b/configure.ac @@ -498,7 +498,9 @@ if test x$have_lcms = xyes; then fi AM_CONDITIONAL(HAVE_LCMS, [test x$have_lcms = xyes]) -AC_PATH_PROG([wayland_scanner], [wayland-scanner]) +WAYLAND_SCANNER_PREFIX=`$PKG_CONFIG --variable=prefix wayland-scanner` +AC_PATH_PROG([wayland_scanner], [wayland-scanner],, + [${WAYLAND_SCANNER_PREFIX}/bin$PATH_SEPARATOR$PATH]) if test x$wayland_scanner = x; then AC_MSG_ERROR([wayland-scanner is needed to compile weston]) fi -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH V2] event: assert wl_event_source pointer is NULL.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/event-loop.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/event-loop.c b/src/event-loop.c index 9790cde..57e3fed 100644 --- a/src/event-loop.c +++ b/src/event-loop.c @@ -312,7 +312,11 @@ wl_event_source_check(struct wl_event_source *source) WL_EXPORT int wl_event_source_remove(struct wl_event_source *source) { - struct wl_event_loop *loop = source-loop; + struct wl_event_loop *loop; + + assert(!source); + + loop = source-loop; /* We need to explicitly remove the fd, since closing the fd * isn't enough in case we've dup'ed the fd. */ -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] event: Cheking for NULL before dereferencing the pointer.
Checking for NULL before dereferencing the wl_event_source pointer so as to avoid crash. Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/event-loop.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/event-loop.c b/src/event-loop.c index 9790cde..b62d16e 100644 --- a/src/event-loop.c +++ b/src/event-loop.c @@ -312,7 +312,12 @@ wl_event_source_check(struct wl_event_source *source) WL_EXPORT int wl_event_source_remove(struct wl_event_source *source) { - struct wl_event_loop *loop = source-loop; + struct wl_event_loop *loop; + + if (source == NULL) + return 0; + + loop = source-loop; /* We need to explicitly remove the fd, since closing the fd * isn't enough in case we've dup'ed the fd. */ -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH] doc: Added API documentation for wl_display_create function.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c |9 + 1 file changed, 9 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index f2b1b42..7b32848 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -788,6 +788,15 @@ bind_display(struct wl_client *client, destroy_client_display_resource); } +/** Create Wayland display object. + * + * \param None + * \return The Wayland display object. Null if failed to create + * + * This creates the wl_display object for the client. + * + * \memberof wl_display + */ WL_EXPORT struct wl_display * wl_display_create(void) { -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH v2] doc: Added API documentation for wl_display_create function.
Signed-off-by: Srivardhan Hebbar sri.heb...@samsung.com --- src/wayland-server.c |9 + 1 file changed, 9 insertions(+) diff --git a/src/wayland-server.c b/src/wayland-server.c index f2b1b42..57b65ce 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -788,6 +788,15 @@ bind_display(struct wl_client *client, destroy_client_display_resource); } +/** Create Wayland display object. + * + * \param None + * \return The Wayland display object. Null if failed to create + * + * This creates the wl_display object. + * + * \memberof wl_display + */ WL_EXPORT struct wl_display * wl_display_create(void) { -- 1.7.9.5 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/wayland-devel