From 715a4588e550a2ca886f31cf060e7aac5085b6b0 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Wed, 1 Aug 2012 14:32:52 +0200 Subject: [PATCH] Fixed wrong return value of ioleast(3) functions. --- libmaxsi/ioleast.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libmaxsi/ioleast.cpp b/libmaxsi/ioleast.cpp index f4656251..14efff69 100644 --- a/libmaxsi/ioleast.cpp +++ b/libmaxsi/ioleast.cpp @@ -1,6 +1,6 @@ /******************************************************************************* - COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2012. + Copyright(C) Jonas 'Sortie' Termansen 2012. This file is part of LibMaxsi. @@ -44,7 +44,7 @@ extern "C" size_t readleast(int fd, void* buf, size_t least, size_t max) void* nextbuf = (uint8_t*) buf + amount; size_t nextleast = least - amount; size_t nextmax = max - amount; - return readleast(fd, nextbuf, nextleast, nextmax); + amount += readleast(fd, nextbuf, nextleast, nextmax); } return amount; } @@ -66,7 +66,7 @@ extern "C" size_t preadleast(int fd, void* buf, size_t least, size_t max, size_t nextleast = least - amount; size_t nextmax = max - amount; off_t nextoff = off + amount; - return preadleast(fd, nextbuf, nextleast, nextmax, nextoff); + amount += preadleast(fd, nextbuf, nextleast, nextmax, nextoff); } return amount; } @@ -86,7 +86,7 @@ extern "C" size_t writeleast(int fd, const void* buf, size_t least, size_t max) const void* nextbuf = (const uint8_t*) buf + amount; size_t nextleast = least - amount; size_t nextmax = max - amount; - return writeleast(fd, nextbuf, nextleast, nextmax); + amount += writeleast(fd, nextbuf, nextleast, nextmax); } return amount; } @@ -108,7 +108,7 @@ extern "C" size_t pwriteleast(int fd, const void* buf, size_t least, size_t max, size_t nextleast = least - amount; size_t nextmax = max - amount; off_t nextoff = off + amount; - return pwriteleast(fd, nextbuf, nextleast, nextmax, nextoff); + amount += pwriteleast(fd, nextbuf, nextleast, nextmax, nextoff); } return amount; }