Index: lib/fuzzer/FuzzerShmemPosix.cpp =================================================================== --- lib/fuzzer/FuzzerShmemPosix.cpp +++ lib/fuzzer/FuzzerShmemPosix.cpp @@ -32,6 +32,8 @@ std::string SharedMemoryRegion::SemName(const char *Name, int Idx) { std::string Res(Name); + if (!Res.empty() && Res[0] != '/') + Res.insert(Res.begin(), '/'); return Res + (char)('0' + Idx); } @@ -52,7 +54,7 @@ for (int i = 0; i < 2; i++) { sem_unlink(SemName(Name, i).c_str()); Semaphore[i] = sem_open(SemName(Name, i).c_str(), O_CREAT, 0644, 0); - if (Semaphore[i] == (void *)-1) + if (Semaphore[i] == SEM_FAILED) return false; } IAmServer = true; @@ -70,7 +72,7 @@ return false; for (int i = 0; i < 2; i++) { Semaphore[i] = sem_open(SemName(Name, i).c_str(), 0); - if (Semaphore[i] == (void *)-1) + if (Semaphore[i] == SEM_FAILED) return false; } IAmServer = false; Index: test/fuzzer/equivalence-signals.test =================================================================== --- test/fuzzer/equivalence-signals.test +++ test/fuzzer/equivalence-signals.test @@ -7,7 +7,7 @@ UNSUPPORTED: darwin RUN: %cpp_compiler %S/EquivalenceATest.cpp -o %t-EquivalenceATest -RUN: %t-EquivalenceATest -timeout=1 -run_equivalence_server=EQUIV_SIG_TEST & export APID=$! +RUN: %t-EquivalenceATest -timeout=1 -run_equivalence_server=EQ_SIG_TEST & export APID=$! RUN: sleep 3 -RUN: %t-EquivalenceATest -timeout=1 -use_equivalence_server=EQUIV_SIG_TEST -runs=500000 2>&1 +RUN: %t-EquivalenceATest -timeout=1 -use_equivalence_server=EQ_SIG_TEST -runs=500000 2>&1 RUN: kill -9 $APID