Merge pull request #33066 from YHNdnzj/logind-linger

logind-user: check linger file in user_wants_service_manager too
This commit is contained in:
Luca Boccassi
2024-05-28 22:41:57 +02:00
committed by GitHub
2 changed files with 10 additions and 4 deletions
+9 -3
View File
@@ -371,13 +371,16 @@ static int user_start_runtime_dir(User *u) {
return 0;
}
static bool user_wants_service_manager(User *u) {
static bool user_wants_service_manager(const User *u) {
assert(u);
LIST_FOREACH(sessions_by_user, s, u->sessions)
if (SESSION_CLASS_WANTS_SERVICE_MANAGER(s->class))
return true;
if (user_check_linger_file(u) > 0)
return true;
return false;
}
@@ -669,9 +672,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)
+1 -1
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);