From 92c07c126fd60a63cd924da94c17fb2992a3ca9f Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 4 Jun 2015 08:08:40 +0200 Subject: [PATCH] xbps_repo_lock: sleep() for a second if the lock is already taken. ... rather than looping continuously. --- lib/repo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/repo.c b/lib/repo.c index 09ec2786..6109510e 100644 --- a/lib/repo.c +++ b/lib/repo.c @@ -102,7 +102,8 @@ xbps_repo_lock(struct xbps_handle *xhp, const char *repodir, return false; } else { xbps_dbg_printf(xhp, "[repo] `%s' lock file exists," - "waiting...\n", lockfile); + "waiting for 1s...\n", lockfile); + sleep(1); } } *lockfname = lockfile;