Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2015-06-20 00:37:47 +0300
committernulltoken <emeric.fermas@gmail.com>2015-06-20 00:37:47 +0300
commit0e3b9f8afd23db3cd0b21aec117865c92e9467d6 (patch)
treef7ce4affd6ffb5f3da969f4952360b2905d16ceb
parent70d0c3b0ec244cfbe76232195400c86c47bb2577 (diff)
parenta6dccd1ab967545840460e259ef3403f8ad5aaca (diff)
Merge pull request #1107 from libgit2/cmn/ensure-next-stream
WriteStream: use libgit2's error when we fail to write to the next stream
-rw-r--r--LibGit2Sharp/Core/WriteStream.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/LibGit2Sharp/Core/WriteStream.cs b/LibGit2Sharp/Core/WriteStream.cs
index 37db8af8..845fecd1 100644
--- a/LibGit2Sharp/Core/WriteStream.cs
+++ b/LibGit2Sharp/Core/WriteStream.cs
@@ -49,16 +49,16 @@ namespace LibGit2Sharp.Core
public override void Write(byte[] buffer, int offset, int count)
{
+ int res;
unsafe
{
fixed (byte* bufferPtr = &buffer[offset])
{
- if (nextStream.write(nextPtr, (IntPtr)bufferPtr, (UIntPtr)count) < 0)
- {
- throw new LibGit2SharpException("failed to write to next buffer");
- }
+ res = nextStream.write(nextPtr, (IntPtr)bufferPtr, (UIntPtr)count);
}
}
+
+ Ensure.Int32Result(res);
}
}
}