When file of size zero is used, we should return success.
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
break;
}
bytesRead += retval;
- if (retval == 0) {
- fret = FILEIO_READ_ERROR_EOF;
- break;
- }
if (bytesRead == totalSize) {
fret = FILEIO_SUCCESS;
break;
}
+ if (retval == 0) {
+ fret = FILEIO_READ_ERROR_EOF;
+ break;
+ }
+
/*
* This is an ambiguous case in linux preadv implementation.
* If the bytesRead matches an exact iovector boundary, we need