| 1046 | |
| 1047 | |
| 1048 | static bool block_size_error(const jrd_file* file, off_t offset, FbStatusVector* status_vector) |
| 1049 | { |
| 1050 | /************************************** |
| 1051 | * |
| 1052 | * b l o c k _ s i z e _ e r r o r |
| 1053 | * |
| 1054 | ************************************** |
| 1055 | * |
| 1056 | * Functional description |
| 1057 | * DB block read incomplete, that may be |
| 1058 | * due to signal caught or unexpected EOF. |
| 1059 | * |
| 1060 | **************************************/ |
| 1061 | struct stat st; |
| 1062 | if (os_utils::fstat(file->fil_desc, &st) < 0) |
| 1063 | return unix_error("fstat", file, isc_io_access_err, status_vector); |
| 1064 | |
| 1065 | if (offset < st.st_size) // we might read more but were interupted |
| 1066 | return true; |
| 1067 | |
| 1068 | Arg::Gds err(isc_io_error); |
| 1069 | err << "read" << file->fil_string << Arg::Gds(isc_block_size); |
| 1070 | |
| 1071 | if (!status_vector) |
| 1072 | ERR_post(err); |
| 1073 | |
| 1074 | ERR_build_status(status_vector, err); |
| 1075 | iscLogStatus(NULL, status_vector); |
| 1076 | return false; |
| 1077 | } |
| 1078 | |
| 1079 | |
| 1080 | #if !(defined HAVE_PREAD && defined HAVE_PWRITE) |
no test coverage detected