summaryrefslogtreecommitdiff
path: root/os/utils.c
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-04-04 15:29:42 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-01 11:36:30 +1000
commit88bacc49f06da5927f716869f5a32672a8297ed0 (patch)
tree322009183b8774de9b15a5cbd3cf4c04a4d972c6 /os/utils.c
parent1d82ec95942b88dd01f0ac6b883368360a0b5fe6 (diff)
os: Add -displayfd option
This option specifies a file descriptor in the launching process. X will scan for an available display number and write that number back to the launching process, at the same time as SIGUSR1 generation. This means display managers don't need to guess at available display numbers. As a consequence, if X fails to start when using -displayfd, it's not because the display was in use, so there's no point in retrying the X launch on a higher display number. Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Julien Cristau <jcristau@debian.org> Tested-by: Julien Cristau <jcristau@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'os/utils.c')
-rw-r--r--os/utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/os/utils.c b/os/utils.c
index 30592d2cc..3a1ef9303 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -659,6 +659,15 @@ ProcessCommandLine(int argc, char *argv[])
else
UseMsg();
}
+ else if (strcmp(argv[i], "-displayfd") == 0) {
+ if (++i < argc) {
+ displayfd = atoi(argv[i]);
+ display = NULL;
+ nolock = TRUE;
+ }
+ else
+ UseMsg();
+ }
#ifdef DPMSExtension
else if (strcmp(argv[i], "dpms") == 0)
/* ignored for compatibility */ ;