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:
parent
ccd31553f3
commit
51e9e6ceda
@ -38,7 +38,6 @@ static bool password_buffer_lock(char *addr, size_t size) {
|
|||||||
swaylock_log_errno(LOG_ERROR, "Unable to mlock() password memory.");
|
swaylock_log_errno(LOG_ERROR, "Unable to mlock() password memory.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user