unsigned long long ToRead = 0;
do {
if (From.Read(Buf.get(),BufSize, &ToRead) == false ||
- (ToRead > 0 && To.Write(Buf.get(),ToRead) == false))
+ To.Write(Buf.get(),ToRead) == false)
return false;
} while (ToRead != 0);
/* */
bool FileFd::Write(const void *From,unsigned long long Size)
{
- ssize_t Res;
+ ssize_t Res = 1;
errno = 0;
- do
+ while (Res > 0 && Size > 0)
{
if (false)
/* dummy so that the rest can be 'else if's */;
if (d != NULL)
d->seekpos += Res;
}
- while (Res > 0 && Size > 0);
if (Size == 0)
return true;
}
bool FileFd::Write(int Fd, const void *From, unsigned long long Size)
{
- ssize_t Res;
+ ssize_t Res = 1;
errno = 0;
- do
+ while (Res > 0 && Size > 0)
{
Res = write(Fd,From,Size);
if (Res < 0 && errno == EINTR)
From = (char const *)From + Res;
Size -= Res;
}
- while (Res > 0 && Size > 0);
if (Size == 0)
return true;