1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-07 21:18:41 +03:00

logind-user: add missing assertion for user_check_linger_file

Also make the function take const User*
This commit is contained in:
Mike Yuan 2024-05-29 00:42:07 +08:00
parent acddb3cb79
commit 194dba5ef5
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3
2 changed files with 6 additions and 3 deletions

View File

@ -669,9 +669,12 @@ int user_get_idle_hint(User *u, dual_timestamp *t) {
return idle_hint;
}
int user_check_linger_file(User *u) {
int user_check_linger_file(const User *u) {
_cleanup_free_ char *cc = NULL;
char *p = NULL;
const char *p;
assert(u);
assert(u->user_record);
cc = cescape(u->user_record->user_name);
if (!cc)

View File

@ -82,7 +82,7 @@ int user_get_idle_hint(User *u, dual_timestamp *t);
int user_save(User *u);
int user_load(User *u);
int user_kill(User *u, int signo);
int user_check_linger_file(User *u);
int user_check_linger_file(const User *u);
void user_elect_display(User *u);
void user_update_last_session_timer(User *u);