summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kunzelmann <maxdev@posteo.de>2023-11-17 13:40:25 +0100
committerSimon Ser <contact@emersion.fr>2023-11-17 13:56:41 +0100
commit51e9e6ceda19b3c0c5f67ec4b0885edf2a2cca37 (patch)
treee921749ae20aa52b8083a27cfed5afd4484d515a
parentccd31553f335f5a67d01e4ddf00b5ed73415e4ca (diff)
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>
-rw-r--r--password-buffer.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/password-buffer.c b/password-buffer.c
index b8b7f94..7b1e465 100644
--- a/password-buffer.c
+++ b/password-buffer.c
@@ -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;