[PATCH 1/2] compositor: Propagate error from module_init

Ondřej Majerech majerech.o at gmail.com
Fri Dec 5 16:39:27 PST 2014


load_modules currently calls module_init, but completely ignores its
return value and instead always returns 0. Its return value appears to
be checked in callers, so we most likely want to propagate any error
signalled by module_init.

Signed-off-by: Ondřej Majerech <majerech.o at gmail.com>
---
 src/compositor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compositor.c b/src/compositor.c
index 53f6220..0b64394 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -4424,7 +4424,8 @@ load_modules(struct weston_compositor *ec, const char *modules,
 		snprintf(buffer, sizeof buffer, "%.*s", (int) (end - p), p);
 		module_init = weston_load_module(buffer, "module_init");
 		if (module_init)
-			module_init(ec, argc, argv);
+			if (module_init(ec, argc, argv) < 0)
+				return -1;
 		p = end;
 		while (*p == ',')
 			p++;
-- 
1.9.3



More information about the wayland-devel mailing list