more precise using PIIODevice::reading_now flag, Warning! one should use it manually now

small enum fix for pip_cmg
This commit is contained in:
2022-10-27 20:58:43 +03:00
parent 609ff8e9c8
commit e46cfdc4bd
11 changed files with 51 additions and 18 deletions

View File

@@ -439,7 +439,10 @@ PIByteArray PIFile::get() {
ssize_t PIFile::readDevice(void * read_to, ssize_t max_size) {
if (!canRead() || PRIVATE->fd == 0) return -1;
return fread(read_to, 1, max_size, PRIVATE->fd);
reading_now = true;
ssize_t ret = fread(read_to, 1, max_size, PRIVATE->fd);
reading_now = false;
return ret;
}