about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-09T08·50+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-06-09T08·54+0200
commit7c4501886d01bfc0c3681201e194cdddfad8595a (patch)
tree2ad788c820b1c1c4b3f724ed7add4de7a0a17210 /src/libstore
parentf2b67fbf2ab7de68ee2e7c12ea090c8190e9546f (diff)
Use std::vector::data()
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index f0a1c1396cfd..5bd745454abe 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2305,7 +2305,6 @@ void DerivationGoal::runChild()
         Strings envStrs;
         foreach (Environment::const_iterator, i, env)
             envStrs.push_back(rewriteHashes(i->first + "=" + i->second, rewritesToTmp));
-        auto envArr = stringsToCharPtrs(envStrs);
 
         /* If we are running in `build-users' mode, then switch to the
            user we allocated above.  Make sure that we drop all root
@@ -2452,7 +2451,6 @@ void DerivationGoal::runChild()
 
         foreach (Strings::iterator, i, drv.args)
             args.push_back(rewriteHashes(*i, rewritesToTmp));
-        auto argArr = stringsToCharPtrs(args);
 
         restoreSIGPIPE();
 
@@ -2466,7 +2464,7 @@ void DerivationGoal::runChild()
         }
 
         /* Execute the program.  This should not return. */
-        execve(builder, (char * *) &argArr[0], (char * *) &envArr[0]);
+        execve(builder, stringsToCharPtrs(args).data(), stringsToCharPtrs(envStrs).data());
 
         throw SysError(format("executing ‘%1%’") % drv.builder);
 
@@ -3094,7 +3092,6 @@ void SubstitutionGoal::tryToRun()
     args.push_back("--substitute");
     args.push_back(storePath);
     args.push_back(destPath);
-    auto argArr = stringsToCharPtrs(args);
 
     /* Fork the substitute program. */
     pid = startProcess([&]() {
@@ -3104,7 +3101,7 @@ void SubstitutionGoal::tryToRun()
         if (dup2(outPipe.writeSide, STDOUT_FILENO) == -1)
             throw SysError("cannot dup output pipe into stdout");
 
-        execv(sub.c_str(), (char * *) &argArr[0]);
+        execv(sub.c_str(), stringsToCharPtrs(args).data());
 
         throw SysError(format("executing ‘%1%’") % sub);
     });