diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index 571e19094b..cf5f39b90a 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -888,11 +888,11 @@ _public_ int sd_session_get_leader(const char *session, pid_t *leader) { return 0; } -_public_ int sd_seat_get_active(const char *seat, char **session, uid_t *uid) { +_public_ int sd_seat_get_active(const char *seat, char **ret_session, uid_t *ret_uid) { _cleanup_free_ char *p = NULL, *s = NULL, *t = NULL; int r; - assert_return(session || uid, -EINVAL); + assert_return(ret_session || ret_uid, -EINVAL); r = file_of_seat(seat, &p); if (r < 0) @@ -906,20 +906,20 @@ _public_ int sd_seat_get_active(const char *seat, char **session, uid_t *uid) { if (r < 0) return r; - if (session && !s) + if (ret_session && !s) return -ENODATA; - if (uid && !t) + if (ret_uid && !t) return -ENODATA; - if (uid && t) { - r = parse_uid(t, uid); + if (ret_uid && t) { + r = parse_uid(t, ret_uid); if (r < 0) return r; } - if (session && s) - *session = TAKE_PTR(s); + if (ret_session && s) + *ret_session = TAKE_PTR(s); return 0; } diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h index 99ca8b8ed5..cb80431b16 100644 --- a/src/systemd/sd-login.h +++ b/src/systemd/sd-login.h @@ -200,7 +200,7 @@ int sd_session_get_tty(const char *session, char **display); int sd_session_get_vt(const char *session, unsigned *vtnr); /* Return active session and user of seat */ -int sd_seat_get_active(const char *seat, char **session, uid_t *uid); +int sd_seat_get_active(const char *seat, char **ret_session, uid_t *ret_uid); /* Return sessions and users on seat. Returns number of sessions. * If sessions is NULL, this returns only the number of sessions. */