Issue Details (XML | Word | Printable)

Key: CORE-6198
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Dmitriy Starodubov
Votes: 0
Watchers: 3

If you were logged in you would be able to see more operations.
Firebird Core

Wrong error checking for pread / pwrite calls

Created: 26/Nov/19 08:56 AM   Updated: 26/Nov/19 08:56 AM
Component/s: Engine
Affects Version/s: 3.0.4, 4.0 Beta 1, 2.5.9
Fix Version/s: None

Environment: POSIX

QA Status: No test

 Description  « Hide
pread and pwrite returns 64bit values (when 64 IO used, of course). Returning values are checked for errors like this
FB_UINT64 bytes;
if ((bytes = pread(file->fil_desc, page, size, LSEEK_OFFSET_CAST offset)) == size)
if (bytes == -1U && !SYSCALL_INTERRUPTED(errno))
return unix_error("read", file, isc_io_read_err, status_vector);
But -1U is 4294967295 and function returns -1UL (18446744073709551615) so check doesn't work.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.