sd-login.c | sd-login.c | |||
---|---|---|---|---|
skipping to change at line 262 | skipping to change at line 262 | |||
if (array) | if (array) | |||
*array = a; | *array = a; | |||
else | else | |||
strv_free(a); | strv_free(a); | |||
return r; | return r; | |||
} | } | |||
_public_ int sd_uid_get_sessions(uid_t uid, int require_active, char ***ses sions) { | _public_ int sd_uid_get_sessions(uid_t uid, int require_active, char ***ses sions) { | |||
return uid_get_array(uid, require_active ? "ACTIVE_SESSIONS" : "SES | return uid_get_array( | |||
SIONS", sessions); | uid, | |||
require_active == 0 ? "ONLINE_SESSIONS" : | ||||
require_active > 0 ? "ACTIVE_SESSIONS" : | ||||
"SESSIONS", | ||||
sessions); | ||||
} | } | |||
_public_ int sd_uid_get_seats(uid_t uid, int require_active, char ***seats) { | _public_ int sd_uid_get_seats(uid_t uid, int require_active, char ***seats) { | |||
return uid_get_array(uid, require_active ? "ACTIVE_SEATS" : "SEATS" | return uid_get_array( | |||
, seats); | uid, | |||
require_active == 0 ? "ONLINE_SEATS" : | ||||
require_active > 0 ? "ACTIVE_SEATS" : | ||||
"SEATS", | ||||
seats); | ||||
} | } | |||
static int file_of_session(const char *session, char **_p) { | static int file_of_session(const char *session, char **_p) { | |||
char *p; | char *p; | |||
int r; | int r; | |||
assert(_p); | assert(_p); | |||
if (session) | if (session) | |||
p = strappend("/run/systemd/sessions/", session); | p = strappend("/run/systemd/sessions/", session); | |||
skipping to change at line 644 | skipping to change at line 654 | |||
DIR *d; | DIR *d; | |||
int r = 0; | int r = 0; | |||
unsigned n = 0; | unsigned n = 0; | |||
uid_t *l = NULL; | uid_t *l = NULL; | |||
d = opendir("/run/systemd/users/"); | d = opendir("/run/systemd/users/"); | |||
if (!d) | if (!d) | |||
return -errno; | return -errno; | |||
for (;;) { | for (;;) { | |||
struct dirent buffer, *de; | struct dirent *de; | |||
union dirent_storage buf; | ||||
int k; | int k; | |||
uid_t uid; | uid_t uid; | |||
k = readdir_r(d, &buffer, &de); | k = readdir_r(d, &buf.de, &de); | |||
if (k != 0) { | if (k != 0) { | |||
r = -k; | r = -k; | |||
goto finish; | goto finish; | |||
} | } | |||
if (!de) | if (!de) | |||
break; | break; | |||
dirent_ensure_type(d, de); | dirent_ensure_type(d, de); | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 15 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |