diff options
Diffstat (limited to 'src/filesystem.c')
-rw-r--r-- | src/filesystem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/filesystem.c b/src/filesystem.c index a12dcba..6b17ccb 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -270,10 +270,11 @@ lilv_symlink(const char* oldpath, const char* newpath) } int -lilv_flock(FILE* file, bool lock) +lilv_flock(FILE* file, bool lock, bool block) { #if defined(HAVE_FLOCK) && defined(HAVE_FILENO) - return flock(fileno(file), lock ? LOCK_EX : LOCK_UN); + return flock(fileno(file), + (lock ? LOCK_EX : LOCK_UN) | (block ? 0 : LOCK_NB)); #else return 0; #endif |