sd-login: fix sd_seat_get_active() to return ENODATA

This seems to be an oversight from:
    707b66c663

We have to return ENODATA instead of ENOENT if a requested entry is
non-present. Also fix the call-site in udev to check for these errors.
This commit is contained in:
David Herrmann 2015-09-08 14:03:22 +02:00
parent 23d08d1b2b
commit 4211d5bd13
2 changed files with 3 additions and 3 deletions

View file

@ -645,10 +645,10 @@ _public_ int sd_seat_get_active(const char *seat, char **session, uid_t *uid) {
return r;
if (session && !s)
return -ENOENT;
return -ENODATA;
if (uid && !t)
return -ENOENT;
return -ENODATA;
if (uid && t) {
r = parse_uid(t, uid);

View file

@ -45,7 +45,7 @@ static int builtin_uaccess(struct udev_device *dev, int argc, char *argv[], bool
seat = "seat0";
r = sd_seat_get_active(seat, NULL, &uid);
if (r == -ENOENT) {
if (r == -ENXIO || r == -ENODATA) {
/* No active session on this seat */
r = 0;
goto finish;