How about this, which reduces duplicate code (note I assume modules is a local variable, if it isn't and it needs to be preserved then a local copy of it should be used):

    if (option_modules) modules = option_modules;
    if (load_modules(ec, modules, &argc, argv, config_file) < 0)
            goto out;

Pier Luigi Fiorini wrote:
Let --modules override modules list and load desktop-shell.so as a
fallback if a modules list is not specified neither by passing
--modules nor with weston.ini.
---
 src/compositor.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 1617d96..e2475c8 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3611,10 +3611,13 @@ int main(int argc, char *argv[])
setenv("WAYLAND_DISPLAY", socket_name, 1); - if (load_modules(ec, modules, &argc, argv, config_file) < 0)
-               goto out;
-       if (load_modules(ec, option_modules, &argc, argv, config_file) < 0)
-               goto out;
+       if (option_modules == NULL) {
+               if (load_modules(ec, modules, &argc, argv, config_file) < 0)
+                       goto out;
+       } else {
+               if (load_modules(ec, option_modules, &argc, argv, config_file) 
< 0)
+                       goto out;
+       }
free(config_file);
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to