Fix retry behaviour in while loop with mlock()

If mlock() fails with errno EAGAIN, it should be retried up to five
times, which is tracked in the retries variable. However, the `return
false` statement after the switch case makes the function return false
after the first failed mlock() call.

Remove this statement to actually retry up to five times.

Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
This commit is contained in:
Max Kunzelmann 2023-11-17 13:40:25 +01:00 committed by Simon Ser
parent ccd31553f3
commit 51e9e6ceda

View file

@ -38,7 +38,6 @@ static bool password_buffer_lock(char *addr, size_t size) {
swaylock_log_errno(LOG_ERROR, "Unable to mlock() password memory.");
return false;
}
return false;
}
return true;