We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b90965 commit 242513bCopy full SHA for 242513b
1 file changed
lib/pkgdb.c
@@ -108,7 +108,14 @@ xbps_pkgdb_lock(struct xbps_handle *xhp)
108
}
109
umask(prev_umask);
110
111
+ if (flock(xhp->lock_fd, LOCK_EX|LOCK_NB) == -1) {
112
+ if (errno != EWOULDBLOCK)
113
+ goto err;
114
+ xbps_warn_printf("package database locked, waiting...\n");
115
+ }
116
+
117
if (flock(xhp->lock_fd, LOCK_EX) == -1) {
118
+err:
119
close(xhp->lock_fd);
120
xhp->lock_fd = -1;
121
return xbps_error_errno(errno, "failed to lock file: %s: %s\n",
0 commit comments