Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
some polishing
  • Loading branch information
adamsitnik committed Jul 8, 2021
commit 731e65c56eb688598d364c0809945cb7839f50bb
2 changes: 1 addition & 1 deletion src/libraries/Native/Unix/System.Native/pal_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ PALEXPORT char* SystemNative_RealPath(const char* path);
PALEXPORT int32_t SystemNative_GetPeerID(intptr_t socket, uid_t* euid);

/**
* Returns file system type on success, or -1 on error or 0 when fstatfs is not supported.
* Returns file system type on success, or -1 on error.
*/
PALEXPORT int64_t SystemNative_GetFileSystemType(intptr_t fd);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ namespace Microsoft.Win32.SafeHandles
{
public sealed partial class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid
{
internal static bool DisableFileLocking { get; } = AppContextConfigHelper.GetBooleanConfig("System.IO.DisableFileLocking", "DOTNET_SYSTEM_IO_DISABLEFILELOCKING", defaultValue: false);
internal static bool DisableFileLocking { get; } = OperatingSystem.IsBrowser() // #40065: Emscripten does not support file locking
|| AppContextConfigHelper.GetBooleanConfig("System.IO.DisableFileLocking", "DOTNET_SYSTEM_IO_DISABLEFILELOCKING", defaultValue: false);

// not using bool? as it's not thread safe
private volatile NullableBool _canSeek = NullableBool.Undefined;
Expand Down Expand Up @@ -328,11 +329,7 @@ private bool CanLockTheFile(Interop.Sys.LockOperations lockOperation, FileAccess
{
Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH);

if (OperatingSystem.IsBrowser())
{
return false; // #40065: Emscripten does not support file locking
}
else if (DisableFileLocking)
if (DisableFileLocking)
{
return false;
}
Expand Down