summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2012-09-11 23:05:24 +0200
committerVicent Marti <tanoku@gmail.com>2012-09-11 23:05:24 +0200
commitc859184bb459d9801a394dc44f5b0b0e55453263 (patch)
tree33039b8911dbcba39e9270b73ee152956444f43d /src/fileops.c
parent1f35e89dbf6e0be8952cc4324a45fd600be5ca05 (diff)
downloadlibgit2-c859184bb459d9801a394dc44f5b0b0e55453263.tar.gz
Properly handle p_reads
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fileops.c b/src/fileops.c
index cbe3d4782..8ccf063d5 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -127,7 +127,7 @@ int git_futils_readbuffer_fd(git_buf *buf, git_file fd, size_t len)
/* p_read loops internally to read len bytes */
read_size = p_read(fd, buf->ptr, len);
- if (read_size < 0) {
+ if (read_size != (ssize_t)len) {
giterr_set(GITERR_OS, "Failed to read descriptor");
return -1;
}