[PATCH weston 1/3] compositor: Make --modules always override other module loading

Rob Bradford robert.bradford at intel.com
Tue Jul 9 04:12:48 PDT 2013


From: Rob Bradford <rob at linux.intel.com>

This allows the test suite to strictly control the modules that get
loaded by the compositor.

https://bugs.freedesktop.org/show_bug.cgi?id=57636
---
 man/weston.man   |  3 ++-
 src/compositor.c | 11 +++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/man/weston.man b/man/weston.man
index 39d854b..04db1ec 100644
--- a/man/weston.man
+++ b/man/weston.man
@@ -128,7 +128,8 @@ instead of writing them to stderr.
 Load the comma-separated list of modules. Only used by the test
 suite. The file is searched for in
 .IR "__weston_modules_dir__" ,
-or you can pass an absolute path.
+or you can pass an absolute path. This overrides the loading of modules from
+the weston.ini file.
 .TP
 \fB\-\^S\fR\fIname\fR, \fB\-\-socket\fR=\fIname\fR
 Weston will listen in the Wayland socket called
diff --git a/src/compositor.c b/src/compositor.c
index 92d89a7..6dfa01e 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3350,10 +3350,13 @@ int main(int argc, char *argv[])
 
 	setenv("WAYLAND_DISPLAY", socket_name, 1);
 
-	if (load_modules(ec, modules, &argc, argv) < 0)
-		goto out;
-	if (load_modules(ec, option_modules, &argc, argv) < 0)
-		goto out;
+	if (option_modules) {
+		if (load_modules(ec, option_modules, &argc, argv) < 0)
+			goto out;
+	} else {
+		if (load_modules(ec, modules, &argc, argv) < 0)
+			goto out;
+	}
 
 	for (i = 1; i < argc; i++)
 		weston_log("fatal: unhandled option: %s\n", argv[i]);
-- 
1.8.3.1



More information about the wayland-devel mailing list