forked from enlightenment/efl
elput: check for a special return value
sd_pid_get_session returns ENODATA or ENXIO if it was unable to fetch the session data for the given pid, reason for that is mostly that the pid is not running is a session. Adding this as the error value can help the user debugging the problem without the need of gdb´ing into the function and checking the return value.
This commit is contained in:
parent
f0325fc190
commit
38554b652a
|
@ -420,9 +420,13 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty)
|
|||
em->seat = eina_stringshare_add(seat);
|
||||
|
||||
ret = sd_pid_get_session(getpid(), &em->sid);
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
ERR("Could not get systemd session");
|
||||
if (ret == -ENODATA || ret == -ENXIO)
|
||||
ERR("Could not get systemd session, the pid is outside a session, check that you are running inside a logind-session.");
|
||||
else
|
||||
ERR("Could not get systemd session");
|
||||
goto session_err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue