summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/posix/filesystem_posix.c4
-rw-r--r--src/zix_config.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/posix/filesystem_posix.c b/src/posix/filesystem_posix.c
index 2ee323a..bb398c1 100644
--- a/src/posix/filesystem_posix.c
+++ b/src/posix/filesystem_posix.c
@@ -349,7 +349,7 @@ zix_canonical_path(ZixAllocator* const allocator, const char* const path)
ZixStatus
zix_file_lock(FILE* const file, const ZixFileLockMode mode)
{
-#if !defined(__EMSCRIPTEN__) && USE_FLOCK && USE_FILENO
+#if USE_FLOCK && USE_FILENO
return zix_posix_status(
flock(fileno(file),
(mode == ZIX_FILE_LOCK_BLOCK) ? LOCK_EX : (LOCK_EX | LOCK_NB)));
@@ -364,7 +364,7 @@ zix_file_lock(FILE* const file, const ZixFileLockMode mode)
ZixStatus
zix_file_unlock(FILE* const file, const ZixFileLockMode mode)
{
-#if !defined(__EMSCRIPTEN__) && USE_FLOCK && USE_FILENO
+#if USE_FLOCK && USE_FILENO
return zix_posix_status(
flock(fileno(file),
(mode == ZIX_FILE_LOCK_BLOCK) ? LOCK_UN : (LOCK_UN | LOCK_NB)));
diff --git a/src/zix_config.h b/src/zix_config.h
index abcd11e..460b712 100644
--- a/src/zix_config.h
+++ b/src/zix_config.h
@@ -116,7 +116,7 @@
// Classic UNIX: flock()
# ifndef HAVE_FLOCK
-# if defined(__APPLE__) || defined(__unix__)
+# if (defined(__APPLE__) || defined(__unix__)) && !defined(__EMSCRIPTEN__)
# define HAVE_FLOCK 1
# endif
# endif