Bug 1053204 - remove redundant close() r=bent
authorSotaro Ikeda <sikeda@mozilla.com>
Wed, 13 Aug 2014 20:57:24 -0700
changeset 221032 8f922378fab092da3e7859a98fdb35fbc6d447f3
parent 221031 0f35b708099874fa4d8283907048bad312db5a33
child 221048 de1d3c229e5ab5a505b28ac9de5937d4aad0b0e1
child 221126 d6daf663bfb22b2ddcb3e289db8d891e920503b1
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs1053204
milestone34.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 1053204 - remove redundant close() r=bent
netwerk/ipc/RemoteOpenFileParent.cpp
--- a/netwerk/ipc/RemoteOpenFileParent.cpp
+++ b/netwerk/ipc/RemoteOpenFileParent.cpp
@@ -50,21 +50,16 @@ RemoteOpenFileParent::OpenSendCloseDelet
       // FileDescriptor does a dup() internally, so we need to close our fd
       close(fd);
     }
   }
 
   // Sending a potentially invalid file descriptor is just fine.
   unused << Send__delete__(this, fileDescriptor);
 
-  if (fileDescriptor.IsValid()) {
-    // close file now that other process has it open, else we'll leak fds in the
-    // parent process.
-    close(fileDescriptor.PlatformHandle());
-  }
-
+  // Current process's file descriptor is closed by FileDescriptor destructor.
 #endif // OS_TYPE
 
   return true;
 }
 
 } // namespace net
 } // namespace mozilla