sd-login: always return two arrays of same length from sd_seat_get_sessions
sd_seat_get_sessions returns two arrays, that in principle should always match: the session names and corresponding uids. The second array could be shorter only if parsing or uid conversion fails. But in that case there is no way to tell *which* uid is wrong, so they are *all* useless. It's better to simplify things and just return an error if parsing fails.
This commit is contained in:
@@ -723,7 +723,7 @@ _public_ int sd_seat_get_sessions(const char *seat, char ***sessions, uid_t **ui
|
||||
|
||||
r = parse_uid(k, b + i);
|
||||
if (r < 0)
|
||||
continue;
|
||||
return r;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user