about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-09T15·58+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-11-09T15·58+0100
commit198dbe7fa1807f7464ef7c15c3fd0d230f7b844e (patch)
tree9de6323624865969161d3d885463b42ca4270d57 /src/libstore
parent10dcee99ed62a775c05f34aa70449945d537e1a2 (diff)
Remove some redundant close() calls
They are unnecessary because we set the close-on-exec flag.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc6
-rw-r--r--src/libstore/local-store.cc2
2 files changed, 0 insertions, 8 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index d1c9f1727ea1..6def0c1c5481 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -368,8 +368,6 @@ void commonChildInit(Pipe & logPipe)
     /* Dup the write side of the logger pipe into stderr. */
     if (dup2(logPipe.writeSide, STDERR_FILENO) == -1)
         throw SysError("cannot pipe standard error into log file");
-    logPipe.readSide.close();
-    logPipe.writeSide.close();
 
     /* Dup stderr to stdout. */
     if (dup2(STDERR_FILENO, STDOUT_FILENO) == -1)
@@ -681,12 +679,10 @@ HookInstance::HookInstance()
             if (chdir("/") == -1) throw SysError("changing into `/");
 
             /* Dup the communication pipes. */
-            toHook.writeSide.close();
             if (dup2(toHook.readSide, STDIN_FILENO) == -1)
                 throw SysError("dupping to-hook read side");
 
             /* Use fd 4 for the builder's stdout/stderr. */
-            builderOut.readSide.close();
             if (dup2(builderOut.writeSide, 4) == -1)
                 throw SysError("dupping builder's stdout/stderr");
 
@@ -2680,8 +2676,6 @@ void SubstitutionGoal::tryToRun()
 
             if (dup2(outPipe.writeSide, STDOUT_FILENO) == -1)
                 throw SysError("cannot dup output pipe into stdout");
-            outPipe.readSide.close();
-            outPipe.writeSide.close();
 
             /* Pass configuration options (including those overriden
                with --option) to the substituter. */
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index bcf367d654b8..d6cdd10d6f88 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -968,8 +968,6 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter &
                with --option) to the substituter. */
             setenv("_NIX_OPTIONS", settings.pack().c_str(), 1);
 
-            fromPipe.readSide.close();
-            toPipe.writeSide.close();
             if (dup2(toPipe.readSide, STDIN_FILENO) == -1)
                 throw SysError("dupping stdin");
             if (dup2(fromPipe.writeSide, STDOUT_FILENO) == -1)