On 03/04/2012 22:25, Chase Douglas wrote:
> 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 <[email protected]>
> Signed-off-by: Chase Douglas 
> <[email protected]>
> Reviewed-by: Julien Cristau <[email protected]>
> Tested-by: Julien Cristau <[email protected]>
> ---

Very much in favour of adding this.

> +    else { /* -displayfd */
> +        Bool found = 0;
> +        for (i = 0; i < 65535 - X_TCP_PORT; i++) {
> +            if (TryCreateSocket(i, &partial) && !partial) {
> +                found = 1;
> +                break;
> +            }
> +            else
> +                CloseWellKnownConnections();
>          }
> -        else {
> -            ListenTransFds = malloc(ListenTransCount * sizeof(int));
> +        if (!found)
> +            FatalError("Failed to find a socket to listen on");
> +        sprintf(dynamic_display, "%d\n", i);
> +        display = dynamic_display;

Would you mind changing this so it doesn't inconsistently add a trailing '\n'
to display if -displayfd was used. (This is difficulty for XWin as we
subsequently use the value of display to point our helper clients at the right
display)


_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to