summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-09-14 16:32:17 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-09-14 16:32:17 +0200
commit5c2682d0effa4b0eef1f18b10757c547e2ba6225 (patch)
treec5d26637c4c2701956e1b81dfa5077918209b88d /apt-pkg/packagemanager.cc
parent821c6533d7ead7ec2e4832e6b3a980cd83c76754 (diff)
parent1d6386f35066c1cc3c053f94fccf379d86075eac (diff)
* merged from apt--mvo
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc22
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