Wrong error checking for pread / pwrite calls
---------------------------------------------
Key: CORE-6198
URL: http://tracker.firebirdsql.org/browse/CORE-6198
Project: Firebird Core
Issue Type: Bug
Components: Engine
Affects Versions: 2.5.9, 4.0 Beta 1, 3.0.4
Environment: POSIX
Reporter: Dmitriy Starodubov
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)
break;
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel