Skip to content

Commit

Permalink
Never use map name on non-win, just file path
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Jul 6, 2024
1 parent 7295d74 commit 2260425
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/SponsorLink/SponsorLink/DiagnosticsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,7 @@ static MemoryMappedFile CreateOrOpenMemoryMappedFile(string mapName, long capaci
else
{
// On Linux, use a file-based memory-mapped file
string filePath = $"/tmp/{mapName}";
using (var fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite))
{
fs.SetLength(capacity);
return MemoryMappedFile.CreateFromFile(fs, mapName, capacity, MemoryMappedFileAccess.ReadWrite, HandleInheritability.None, false);
}
return MemoryMappedFile.CreateFromFile($"/tmp/{mapName}", FileMode.OpenOrCreate);
}
}

Expand Down

0 comments on commit 2260425

Please sign in to comment.