head 1.2; access; symbols pkgsrc-2021Q2:1.1.0.42 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.40 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.38 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.36 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.32 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.12 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.34 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.30 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.28 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.26 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.24 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.22 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.20 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.18 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.16 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.14 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.10 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.8 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.6 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.4 pkgsrc-2016Q3-base:1.1 pkgsrc-2016Q2:1.1.0.2 pkgsrc-2016Q2-base:1.1; locks; strict; comment @// @; 1.2 date 2021.08.05.08.01.18; author adam; state dead; branches; next 1.1; commitid M8HQkBO0cgiUWK3D; 1.1 date 2016.06.30.12.16.24; author kamil; state Exp; branches; next ; commitid DUzYYNiI3yoxcucz; desc @@ 1.2 log @coreclr: removed; approved by @@kamil @ text @$NetBSD: patch-src_debug_debug-pal_unix_twowaypipe.cpp,v 1.1 2016/06/30 12:16:24 kamil Exp $ Revert: commit 5ac6af932fe2a3f4b285b6dcc79010caf807ea9d Author: Mike McLaughlin Date: Fri May 27 20:03:32 2016 -0700 Fix the named semaphore leak on OSX (and Linux) (#5269) It broke NetBSD. --- src/debug/debug-pal/unix/twowaypipe.cpp.orig 2016-06-14 01:12:15.000000000 +0000 +++ src/debug/debug-pal/unix/twowaypipe.cpp @@@@ -3,14 +3,31 @@@@ // See the LICENSE file in the project root for more information. #include + #include #include #include #include #include #include + #include "twowaypipe.h" +static const char* PipeNameFormat = "/tmp/clr-debug-pipe-%d-%llu-%s"; + +void TwoWayPipe::GetPipeName(char *name, DWORD id, const char *suffix) +{ + BOOL ret = GetProcessIdDisambiguationKey(id, &m_disambiguationKey); + + // If GetProcessIdDisambiguationKey failed for some reason, it should set the value + // to 0. We expect that anyone else making the pipe name will also fail and thus will + // also try to use 0 as the value. + _ASSERTE(ret == TRUE || m_disambiguationKey == 0); + + int chars = _snprintf(name, MaxPipeNameLength, PipeNameFormat, id, m_disambiguationKey, suffix); + _ASSERTE(chars > 0 && chars < MaxPipeNameLength); +} + // Creates a server side of the pipe. // Id is used to create pipes names and uniquely identify the pipe on the machine. // true - success, false - failure (use GetLastError() for more details) @@@@ -21,8 +38,8 @@@@ bool TwoWayPipe::CreateServer(DWORD id) return false; m_id = id; - PAL_GetTransportPipeName(m_inPipeName, id, "in"); - PAL_GetTransportPipeName(m_outPipeName, id, "out"); + GetPipeName(m_inPipeName, id, "in"); + GetPipeName(m_outPipeName, id, "out"); if (mkfifo(m_inPipeName, S_IRWXU) == -1) { @@@@ -50,8 +67,8 @@@@ bool TwoWayPipe::Connect(DWORD id) m_id = id; //"in" and "out" are switched deliberately, because we're on the client - PAL_GetTransportPipeName(m_inPipeName, id, "out"); - PAL_GetTransportPipeName(m_outPipeName, id, "in"); + GetPipeName(m_inPipeName, id, "out"); + GetPipeName(m_outPipeName, id, "in"); // Pipe opening order is reversed compared to WaitForConnection() // in order to avaid deadlock. @@@@ -190,4 +207,5 @@@@ void TwoWayPipe::CleanupTargetProcess() { unlink(m_inPipeName); unlink(m_outPipeName); + PAL_CleanupTargetProcess(m_id, m_disambiguationKey); } @ 1.1 log @Import CoreCLR 1.0.0 as lang/coreclr This repo contains the .NET Core runtime, called CoreCLR, and the base library, called mscorlib. It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. @ text @d1 1 a1 1 $NetBSD$ @