Skip to content
  • Ray Strode's avatar
    common: don't bail if session disappears out from under us · 83666d60
    Ray Strode authored
    It's entirely possible for a session returned by
    sd_seat_get_sessions to disappear immediately after the
    sd_seat_get_sessions call returns.  This is especially
    likely at logout time where the session will briefly be
    in the "closing" state before getting reaped.
    
    If that happens when we're looking for a greeter session, we
    stop looking for a greeter session and bail out all confused.
    
    This commit fixes the confusion by gracefully handling the
    session disappearing by just proceeding to the next session
    in the list.
    
    This commit is very similar to commit 155ee7ec which got
    accidentally reverted during code consolidation. The main
    difference is this commit checks the correct error code
    of -ENXIO instead of -ENOENT, so it might actually fix
    what it's ostensibly supposed to fix.
    83666d60