Bug 1289316 - Update ProcessUtils_linux with PlatformHandle changes r=valentin
authorFabrice Desré <fabrice@mozilla.com>
Tue, 26 Jul 2016 03:47:18 -0700
changeset 348798 12ebefcfed9807c6b433afb402a104c45ae3e270
parent 348797 784f2a4f0d225a6d945b2309dd479d7ae2d30527
child 348799 fa5ba1af68d09baf15b9ac71b05b067997b75477
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1289316
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1289316 - Update ProcessUtils_linux with PlatformHandle changes r=valentin
ipc/glue/ProcessUtils_linux.cpp
--- a/ipc/glue/ProcessUtils_linux.cpp
+++ b/ipc/glue/ProcessUtils_linux.cpp
@@ -373,21 +373,21 @@ ProcLoaderLoadRunner::ShuffleFds()
 
   MOZ_ASSERT(mFdsRemap.Length() <= kReservedFileDescriptors);
 
   InjectiveMultimap fd_shuffle;
   fd_shuffle.reserve(mFdsRemap.Length());
 
   for (i = 0; i < mFdsRemap.Length(); i++) {
     const FDRemap *map = &mFdsRemap[i];
-    int fd = map->fd().PlatformHandle();
+    auto rawFD = map->fd().ClonePlatformHandle();
     int tofd = map->mapto();
 
     // The FD that is dup2()'d from needs to be closed after shuffling.
-    fd_shuffle.push_back(InjectionArc(fd, tofd, /*in_close=*/true));
+    fd_shuffle.push_back(InjectionArc(rawFD.get(), tofd, /*in_close=*/true));
 
     // Erase from sReservedFds we will use.
     for (int* toErase = sReservedFds->begin();
          toErase < sReservedFds->end();
          toErase++) {
       if (tofd == *toErase) {
         sReservedFds->erase(toErase);
         break;