From: Jelle van der Waa Date: Sat, 17 May 2025 18:00:52 +0000 (+0200) Subject: sd-login: rename sd_seat_get_active arguments X-Git-Tag: v258-rc1~559^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26b5eea47f5c72c4c5381ec7959facc6073eb334;p=thirdparty%2Fsystemd.git sd-login: rename sd_seat_get_active arguments Follow the argument comment naming. --- diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index 571e19094bc..cf5f39b90ac 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 99ca8b8ed51..cb80431b16f 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. */