]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-login: rename sd_seat_get_active arguments
authorJelle van der Waa <jvanderwaa@redhat.com>
Sat, 17 May 2025 18:00:52 +0000 (20:00 +0200)
committerJelle van der Waa <jvanderwaa@redhat.com>
Wed, 21 May 2025 08:50:48 +0000 (10:50 +0200)
Follow the argument comment naming.

src/libsystemd/sd-login/sd-login.c
src/systemd/sd-login.h

index 571e19094bc593437e9fe41be1f6258ffd3e74bf..cf5f39b90ac6af9b3a7fa2769c478a1fe90821c3 100644 (file)
@@ -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;
 }
index 99ca8b8ed510778422220e00c8970d6f7b98fd88..cb80431b16ffbbf5162d2a2afeacc81b9bb31e2f 100644 (file)
@@ -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. */