[PATCH weston 1/6] compositor: postpone unhandled option check

Pekka Paalanen ppaalanen at gmail.com
Tue Mar 24 06:56:15 PDT 2015


From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>

Move the code that checks for unhandled command line options only after
all the module loading. We pass argc, argv to all module loaders, so
modules might want to have command line options, but you cannot use them
if the check is too early.

Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 src/compositor.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compositor.c b/src/compositor.c
index 47da818..11730e2 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -5330,11 +5330,6 @@ int main(int argc, char *argv[])
 	ec->default_pointer_grab = NULL;
 	ec->exit_code = EXIT_SUCCESS;
 
-	for (i = 1; i < argc; i++)
-		weston_log("fatal: unhandled option: %s\n", argv[i]);
-	if (argc > 1)
-		goto out;
-
 	weston_compositor_log_capabilities(ec);
 
 	server_socket = getenv("WAYLAND_SERVER_SOCKET");
@@ -5386,6 +5381,11 @@ int main(int argc, char *argv[])
 		}
 	}
 
+	for (i = 1; i < argc; i++)
+		weston_log("fatal: unhandled option: %s\n", argv[i]);
+	if (argc > 1)
+		goto out;
+
 	weston_compositor_wake(ec);
 
 	wl_display_run(display);
-- 
2.0.5



More information about the wayland-devel mailing list