Parcourir la source

[2831] Reset the parent's segment before forking

Though we won't have two readers at the same time, it's best we
reset the segment so that it's not carried over for the child
to use accidentally.
Mukund Sivaraman il y a 12 ans
Parent
commit
3469f1a875
1 fichiers modifiés avec 1 ajouts et 0 suppressions
  1. 1 0
      src/lib/util/tests/memory_segment_mapped_unittest.cc

+ 1 - 0
src/lib/util/tests/memory_segment_mapped_unittest.cc

@@ -384,6 +384,7 @@ TEST_F(MemorySegmentMappedTest, multiProcess) {
     ptr = segment_->getNamedAddress("test address");
     ASSERT_TRUE(ptr);
     EXPECT_EQ(424242, *static_cast<const uint32_t*>(ptr));
+    segment_.reset();
 
     // Spawn another process and have it open and read the same data
     int pipes[2];