summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/fileutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2015-05-22 18:08:19 +0200
committerMichael Vogt <mvo@ubuntu.com>2015-05-22 18:08:19 +0200
commitc2e39004370846f465cf60b6fb312664981179d8 (patch)
treef9bfabdf95f3768a9b829327d08c58ffa14e36a9 /apt-pkg/contrib/fileutl.cc
parentaccd8215ca9a1cb10e92a059d71eb02aac2f0743 (diff)
parentba95c69681dee8a0ae12ba635e56414820ee9113 (diff)
Merge branch 'debian/sid' into ubuntu/master
Conflicts: debian/changelog
Diffstat (limited to 'apt-pkg/contrib/fileutl.cc')
-rw-r--r--apt-pkg/contrib/fileutl.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 1ba4674e5..1e6d96fe9 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -778,8 +778,9 @@ pid_t ExecFork(std::set<int> KeepFDs)
signal(SIGCONT,SIG_DFL);
signal(SIGTSTP,SIG_DFL);
+ long ScOpenMax = sysconf(_SC_OPEN_MAX);
// Close all of our FDs - just in case
- for (int K = 3; K != sysconf(_SC_OPEN_MAX); K++)
+ for (int K = 3; K != ScOpenMax; K++)
{
if(KeepFDs.find(K) == KeepFDs.end())
fcntl(K,F_SETFD,FD_CLOEXEC);