From 63cf187f9e87bed304d125f4ca504be0f273ac2b Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Mon, 2 Sep 2019 16:09:18 +0900 Subject: [PATCH] Imported Upstream version 14.45.18 --- VERSION.cmake | 4 ++-- package/libzypp.changes | 6 ++++++ zypp/ExternalProgram.cc | 25 ++++++++++++++----------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 3fedcce..496bf85 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -61,8 +61,8 @@ SET(LIBZYPP_MAJOR "14") SET(LIBZYPP_COMPATMINOR "39") SET(LIBZYPP_MINOR "45") -SET(LIBZYPP_PATCH "17") +SET(LIBZYPP_PATCH "18") # -# LAST RELEASED: 14.45.17 (39) +# LAST RELEASED: 14.45.18 (39) # (The number in parenthesis is LIBZYPP_COMPATMINOR) #======= diff --git a/package/libzypp.changes b/package/libzypp.changes index a36510e..7181c36 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Oct 1 14:37:39 CEST 2018 - ma@suse.de + +- Fix blocking wait for finished child process (bsc#1109877) +- version 14.45.18 (39) + +------------------------------------------------------------------- Fri Aug 31 08:28:08 CEST 2018 - ma@suse.de - lsof: use '-K i' if lsof supports it (bsc#1099847, bsc#1036304) diff --git a/zypp/ExternalProgram.cc b/zypp/ExternalProgram.cc index d415298..fbdffd2 100644 --- a/zypp/ExternalProgram.cc +++ b/zypp/ExternalProgram.cc @@ -476,20 +476,23 @@ namespace zypp { } while ( true ); } - // Wait for child to exit - int ret; - int status = 0; - do + if ( pid > 0 ) // bsc#1109877: must re-check! running() in the loop above may have already waited. { - ret = waitpid(pid, &status, 0); - } - while (ret == -1 && errno == EINTR); + // Wait for child to exit + int ret; + int status = 0; + do + { + ret = waitpid(pid, &status, 0); + } + while (ret == -1 && errno == EINTR); - if (ret != -1) - { - _exitStatus = checkStatus( status ); + if (ret != -1) + { + _exitStatus = checkStatus( status ); + } + pid = -1; } - pid = -1; } return _exitStatus; -- 2.7.4