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:
parent
23d08d1b2b
commit
4211d5bd13
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue