8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 16:03:02 +01:00

posix_fadvise() does not return error code in errno

This commit is contained in:
alexpeshkoff 2009-04-22 06:59:26 +00:00
parent 0d619be734
commit af23324f8c

View File

@ -373,10 +373,12 @@ void NBackup::open_database_scan()
if (dbase < 0) if (dbase < 0)
b_error::raise(uSvc, "Error (%d) opening database file: %s", errno, dbname.c_str()); b_error::raise(uSvc, "Error (%d) opening database file: %s", errno, dbname.c_str());
#ifdef HAVE_POSIX_FADVISE #ifdef HAVE_POSIX_FADVISE
if (posix_fadvise(dbase, 0, 0, POSIX_FADV_SEQUENTIAL) < 0) int rc = posix_fadvise(dbase, 0, 0, POSIX_FADV_SEQUENTIAL);
b_error::raise(uSvc, "Error (%d) in posix_fadvise(SEQUENTIAL) for %s", errno, dbname.c_str()); if (rc)
if (posix_fadvise(dbase, 0, 0, POSIX_FADV_NOREUSE) < 0) b_error::raise(uSvc, "Error (%d) in posix_fadvise(SEQUENTIAL) for %s", rc, dbname.c_str());
b_error::raise(uSvc, "Error (%d) in posix_fadvise(NOREUSE) for %s", errno, dbname.c_str()); rc = posix_fadvise(dbase, 0, 0, POSIX_FADV_NOREUSE);
if (rc)
b_error::raise(uSvc, "Error (%d) in posix_fadvise(NOREUSE) for %s", rc, dbname.c_str());
#endif // HAVE_POSIX_FADVISE #endif // HAVE_POSIX_FADVISE
#endif // WIN_NT #endif // WIN_NT
} }