logind: improve error propagation of user_check_linger_file()
Let's make this a bit prettier, and propagate unexpected access() errors correctly. (The callers of this function will suppress them, but it's nicer of they do that, rather than us doing that twice in both the callers and the callees)
This commit is contained in:
parent
d5ac9d0602
commit
6996df9b86
|
@ -530,8 +530,14 @@ int user_check_linger_file(User *u) {
|
|||
return -ENOMEM;
|
||||
|
||||
p = strjoina("/var/lib/systemd/linger/", cc);
|
||||
if (access(p, F_OK) < 0) {
|
||||
if (errno != ENOENT)
|
||||
return -errno;
|
||||
|
||||
return access(p, F_OK) >= 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool user_may_gc(User *u, bool drop_not_started) {
|
||||
|
|
Loading…
Reference in New Issue