xbps_repo_lock: sleep() for a second if the lock is already taken.

... rather than looping continuously.
This commit is contained in:
Juan RP 2015-06-04 08:08:40 +02:00
parent 60c8bd7fef
commit 92c07c126f

View File

@ -102,7 +102,8 @@ xbps_repo_lock(struct xbps_handle *xhp, const char *repodir,
return false; return false;
} else { } else {
xbps_dbg_printf(xhp, "[repo] `%s' lock file exists," xbps_dbg_printf(xhp, "[repo] `%s' lock file exists,"
"waiting...\n", lockfile); "waiting for 1s...\n", lockfile);
sleep(1);
} }
} }
*lockfname = lockfile; *lockfname = lockfile;