diff options
author | Peter Karlsson <peterk@debian.org> | 2007-10-08 11:44:54 +0100 |
---|---|---|
committer | Peter Karlsson <peterk@debian.org> | 2007-10-08 11:44:54 +0100 |
commit | 21231056c2f4fb82730c0ac7e7f90456668cae38 (patch) | |
tree | 1f9ca6a27065dce5014adea7095596ec6a8cb744 /apt-pkg/packagemanager.cc | |
parent | 28b68bf4207be80d4549579f34262f1248a2e528 (diff) | |
parent | 24401c09f0a826ec0074f46dfe70efe3aaf79f25 (diff) |
Merge upstream.
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r-- | apt-pkg/packagemanager.cc | 22 |
1 files changed, 21 insertions, 1 deletions
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 <apti18n.h> #include <iostream> - /*}}}*/ +#include <fcntl.h> 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 |