From 1d6386f35066c1cc3c053f94fccf379d86075eac Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 14 Sep 2007 15:28:14 +0200 Subject: * apt-pkg/packagemanager.{cc,h}: - move DoInstallPostFork() out of the header into the .cc file --- apt-pkg/packagemanager.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'apt-pkg/packagemanager.cc') diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 10e2858ed..d6172c6c4 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -25,7 +25,7 @@ #include #include - /*}}}*/ +#include using namespace std; @@ -624,6 +624,26 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() return Completed; } /*}}}*/ +// PM::DoInstallPostFork - Does install part that happens after the fork /*{{{*/ +// --------------------------------------------------------------------- +pkgPackageManager::OrderResult +pkgPackageManager::DoInstallPostFork(int statusFd) +{ + if(statusFd > 0) + // FIXME: use SetCloseExec here once it taught about throwing + // exceptions instead of doing _exit(100) on failure + fcntl(statusFd,F_SETFD,FD_CLOEXEC); + bool goResult = Go(statusFd); + if(goResult == false) + return Failed; + + // if all was fine update the state file + if(Res == Completed) { + Cache.writeStateFile(NULL); + } + return Res; +}; + // PM::DoInstall - Does the installation /*{{{*/ // --------------------------------------------------------------------- /* This uses the filenames in FileNames and the information in the -- cgit v1.2.3