Skip to content
Closed
Prev Previous commit
fix the Unix build
  • Loading branch information
adamsitnik committed Aug 19, 2021
commit aa344274a253eccf5deb7c11a7cfddd5ba86bf55
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ internal static unsafe void WriteAtOffset(SafeFileHandle handle, ReadOnlySpan<by

// POSIX requires that pwrite should respect provided offset even for handles opened with O_APPEND.
// But Linux and BSD don't do that, moreover their behaviour is different. So we always use write for O_APPEND.
int bytesWritten = handle.CanSeek && !handle.IsAppend
int bytesWritten = handle.CanSeek && !handle.IsAppend
? Interop.Sys.PWrite(handle, bufPtr, GetNumberOfBytesToWrite(buffer.Length), fileOffset)
: Interop.Sys.Write(handle, bufPtr, GetNumberOfBytesToWrite(buffer.Length));
FileStreamHelpers.CheckFileCall(bytesWritten, handle.Path);
Expand Down