• Keith Packard's avatar
    os: Use NotifyFd interface for listen descriptors · c468be80
    Keith Packard authored
     Bundle X.org backport of these commits:
    
     commit 7ea64fb4374504bd3d524fc08c90efdab9f253ea
     Author: Alan Coopersmith <alan.coopersmith@oracle.com>
     Date:   Mon Mar 9 09:55:57 2015 -0700
    
        Clear ListenTransConns entries in CloseWellKnownConnections
    
        Since _XSERVTransClose frees the connection pointer passed to it,
        remove that pointer from the array, so we don't try to double free it
        if we come back into CloseWellKnownConnections again.
    
        Should fix https://bugzilla.yoctoproject.org/show_bug.cgi?id=6665 in which
        the shutdown section of the main() loop called CloseWellKnownConnections()
        and then moved on to ddxGiveUp(), which failed to release the VT and thus
        called AbortServer(), which called CloseWellKnownConnections() again.
    Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net>
    
     commit 7b02f0b87ec2fa0cc5a65307a1fd55c671cec884
     Author: Keith Packard <keithp@keithp.com>
     Date:   Wed Nov 11 22:02:17 2015 -0800
    
        os: Use NotifyFd interface for listen descriptors
    
        Replace the custom path for dealing with new incoming connections with
        the general-purpose NotifyFd API.
    Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
    
     commit ba71b69f94f00a6f6910597185610668e79c10be
     Author: Alan Coopersmith <alan.coopersmith@oracle.com>
     Date:   Fri Jan 1 17:34:41 2016 -0800
    
        Avoid segfault in CloseWellKnownConnections when using -displayfd
    
        When -displayfd is looping through the possible display ids to use,
        if it can't open all the listening sockets for one (say when :0 is
        already in use), it calls CloseWellKnownConnections to close all
        the ListenTransConns entries before the point that ListenTransFds
        was allocated & initialized, so CloseWellKnownConnections would
        segfault trying to read entries from a NULL ListenTransFds pointer.
    
        Introduced by commit 7b02f0b8
    Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: 's avatarKeith Packard <keithp@keithp.com>
    Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
    c468be80
WaitFor.c 23.1 KB