mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 01:23:03 +01:00
I see no explicit need to emulate POSIX semantics and allow shared deletes.
This commit is contained in:
parent
0e5d864db2
commit
6b69bc673f
@ -288,8 +288,8 @@ void nbackup::seek_file(FILE_HANDLE &file, SINT64 pos)
|
||||
void nbackup::open_database_write()
|
||||
{
|
||||
#ifdef WIN_NT
|
||||
dbase = CreateFile(dbname.c_str(), GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
dbase = CreateFile(dbname.c_str(), GENERIC_READ | GENERIC_WRITE,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (dbase == INVALID_HANDLE_VALUE)
|
||||
b_error::raise("Error (%d) opening database file: %s", GetLastError(), dbname.c_str());
|
||||
@ -310,8 +310,8 @@ void nbackup::open_database_scan()
|
||||
// and OS itself. Basically, reading any large file brings the whole system
|
||||
// down for extended period of time. Documented workaround is to avoid using
|
||||
// system cache when reading large files.
|
||||
dbase = CreateFile(dbname.c_str(),
|
||||
GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
|
||||
dbase = CreateFile(dbname.c_str(), GENERIC_READ,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN | FILE_FLAG_NO_BUFFERING,
|
||||
NULL);
|
||||
if (dbase == INVALID_HANDLE_VALUE)
|
||||
@ -326,7 +326,7 @@ void nbackup::open_database_scan()
|
||||
void nbackup::create_database()
|
||||
{
|
||||
#ifdef WIN_NT
|
||||
dbase = CreateFile(dbname.c_str(), GENERIC_READ | GENERIC_WRITE, FILE_SHARE_DELETE,
|
||||
dbase = CreateFile(dbname.c_str(), GENERIC_READ | GENERIC_WRITE, 0,
|
||||
NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
if (dbase == INVALID_HANDLE_VALUE)
|
||||
b_error::raise("Error (%d) creating database file: %s", GetLastError(), dbname.c_str());
|
||||
@ -349,7 +349,7 @@ void nbackup::close_database()
|
||||
void nbackup::open_backup_scan()
|
||||
{
|
||||
#ifdef WIN_NT
|
||||
backup = CreateFile(bakname.c_str(), GENERIC_READ, 0,
|
||||
backup = CreateFile(bakname.c_str(), GENERIC_READ, 0,
|
||||
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
if (backup == INVALID_HANDLE_VALUE)
|
||||
b_error::raise("Error (%d) opening backup file: %s", GetLastError(), bakname.c_str());
|
||||
@ -366,8 +366,8 @@ void nbackup::create_backup()
|
||||
if (bakname == "stdout") {
|
||||
backup = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
}
|
||||
else {
|
||||
backup = CreateFile(bakname.c_str(), GENERIC_WRITE, FILE_SHARE_DELETE,
|
||||
else {
|
||||
backup = CreateFile(bakname.c_str(), GENERIC_WRITE, 0,
|
||||
NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
|
||||
}
|
||||
if (backup == INVALID_HANDLE_VALUE)
|
||||
|
Loading…
Reference in New Issue
Block a user