compositor: Propagate errors from module_init
load_modules currently ignores errors signalled by both weston_load_module and module_init, and instead always returns 0. Its return value appears to be checked in callers, so we most likely want to propagate any errors. Signed-off-by: Ondřej Majerech <majerech.o@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
389a10d705
commit
01e98b65c6
+4
-2
@@ -4479,8 +4479,10 @@ load_modules(struct weston_compositor *ec, const char *modules,
|
|||||||
end = strchrnul(p, ',');
|
end = strchrnul(p, ',');
|
||||||
snprintf(buffer, sizeof buffer, "%.*s", (int) (end - p), p);
|
snprintf(buffer, sizeof buffer, "%.*s", (int) (end - p), p);
|
||||||
module_init = weston_load_module(buffer, "module_init");
|
module_init = weston_load_module(buffer, "module_init");
|
||||||
if (module_init)
|
if (!module_init)
|
||||||
module_init(ec, argc, argv);
|
return -1;
|
||||||
|
if (module_init(ec, argc, argv) < 0)
|
||||||
|
return -1;
|
||||||
p = end;
|
p = end;
|
||||||
while (*p == ',')
|
while (*p == ',')
|
||||||
p++;
|
p++;
|
||||||
|
|||||||
Reference in New Issue
Block a user