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

Merge pull request #301 from stbergmann/handlecompare

Fix checks for null HANDLE in Windows-only code
This commit is contained in:
Vlad Khorsun 2020-12-05 01:34:26 +02:00 committed by hvlad
parent 186d27dcd9
commit 9fc2640278

View File

@ -383,7 +383,7 @@ FB_SIZE_T NBackup::read_file(FILE_HANDLE &file, void *buffer, FB_SIZE_T bufsize)
#ifdef WIN_NT
// Read child's stderr often to prevent child process hung if it writes
// too much data to the pipe and overflow the pipe buffer.
const bool checkChild = (childStdErr > 0 && file == backup);
const bool checkChild = (childStdErr != 0 && file == backup);
if (checkChild)
print_child_stderr();
@ -795,7 +795,7 @@ void NBackup::close_backup()
return;
#ifdef WIN_NT
CloseHandle(backup);
if (childId > 0)
if (childId != 0)
{
const bool killed = (WaitForSingleObject(childId, 5000) != WAIT_OBJECT_0);
if (killed)