summaryrefslogtreecommitdiff
path: root/hw/kdrive/ephyr/ephyrinit.c
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2015-03-31 09:14:25 +0200
committerKeith Packard <keithp@keithp.com>2015-05-12 09:49:49 -0700
commit5af73f490870da9265eeb9b3ce59a2be026be0c8 (patch)
tree0dc052aa8115d4e620cbc5d5163488d97a7ecc03 /hw/kdrive/ephyr/ephyrinit.c
parent00f79416b19f0cde68291aced44ab07b9b76f7b8 (diff)
Xephyr: Don't crash when no command line argument is specified
The DDX specific command line parsing function only gets called if command line arguments are present. Therefore this function is not suitable to initialize mandatory global variables. Replace main() instead. Signed-off-by: Egbert Eich <eich@freedesktop.org> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/kdrive/ephyr/ephyrinit.c')
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 897aa1955..8fbaf1d44 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -52,6 +52,13 @@ void processScreenOrOutputArg(const char *screen_size, const char *output, char
void processOutputArg(const char *output, char *parent_id);
void processScreenArg(const char *screen_size, char *parent_id);
+int
+main(int argc, char *argv[], char *envp[])
+{
+ hostx_use_resname(basename(argv[0]), 0);
+ return dix_main(argc, argv, envp);
+}
+
void
InitCard(char *name)
{
@@ -209,10 +216,6 @@ ddxProcessArgument(int argc, char **argv, int i)
EPHYR_DBG("mark argv[%d]='%s'", i, argv[i]);
- if (i == 1) {
- hostx_use_resname(basename(argv[0]), 0);
- }
-
if (!strcmp(argv[i], "-parent")) {
if (i + 1 < argc) {
int j;