lock-util: Add LOCK_NONE

This commit is contained in:
Daan De Meyer
2023-06-15 17:10:35 +02:00
parent 3bba91ef44
commit 0867a46534
3 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -1177,7 +1177,7 @@ int xopenat_lock(
/* POSIX/UNPOSIX locks don't work on directories (errno is set to -EBADF so let's return early with
* the same error here). */
if (FLAGS_SET(open_flags, O_DIRECTORY) && locktype != LOCK_BSD)
if (FLAGS_SET(open_flags, O_DIRECTORY) && !IN_SET(locktype, LOCK_BSD, LOCK_NONE))
return -EBADF;
for (;;) {