[PATCH] Override modules list and don't always load desktop-shell.so

Bill Spitzak spitzak at gmail.com
Mon Apr 1 10:02:12 PDT 2013


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);
>  


More information about the wayland-devel mailing list