MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / block_size_error

Function block_size_error

src/jrd/os/posix/unix.cpp:1048–1077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1046
1047
1048static 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)

Callers 2

PIO_headerFunction · 0.85
PIO_readFunction · 0.85

Calls 6

fstatFunction · 0.85
unix_errorFunction · 0.85
GdsClass · 0.85
ERR_build_statusFunction · 0.85
iscLogStatusFunction · 0.85
ERR_postFunction · 0.50

Tested by

no test coverage detected