From 9fc2640278810fdf5363508519a61da178403f8e Mon Sep 17 00:00:00 2001 From: Vlad Khorsun Date: Sat, 5 Dec 2020 01:34:26 +0200 Subject: [PATCH] Merge pull request #301 from stbergmann/handlecompare Fix checks for null HANDLE in Windows-only code --- src/utilities/nbackup/nbackup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utilities/nbackup/nbackup.cpp b/src/utilities/nbackup/nbackup.cpp index 10c63905ea..5fc38201af 100644 --- a/src/utilities/nbackup/nbackup.cpp +++ b/src/utilities/nbackup/nbackup.cpp @@ -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)