summaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorAditya Mandaleeka <adityam@microsoft.com>2016-02-18 18:43:52 -0800
committerAditya Mandaleeka <adityam@microsoft.com>2016-02-18 18:43:52 -0800
commit0208fdd15297dd76a088d5af412746ba3e6d7bf2 (patch)
treef72126406ae34204fd8e54d0db4954a5907df6cb /src/debug
parent2bb58c00bbd05465ce0e8abcc8bd2a9ea8cf6dc3 (diff)
downloadcoreclr-0208fdd15297dd76a088d5af412746ba3e6d7bf2.tar.gz
coreclr-0208fdd15297dd76a088d5af412746ba3e6d7bf2.tar.bz2
coreclr-0208fdd15297dd76a088d5af412746ba3e6d7bf2.zip
Disambiguate debug pipe names with more than just PID.
Diffstat (limited to 'src/debug')
-rw-r--r--src/debug/debug-pal/unix/twowaypipe.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/debug/debug-pal/unix/twowaypipe.cpp b/src/debug/debug-pal/unix/twowaypipe.cpp
index 062dc1a145..2892ef8125 100644
--- a/src/debug/debug-pal/unix/twowaypipe.cpp
+++ b/src/debug/debug-pal/unix/twowaypipe.cpp
@@ -13,11 +13,19 @@
#include "twowaypipe.h"
-#define PIPE_NAME_FORMAT_STR "/tmp/clr-debug-pipe-%d-%s"
+#define PIPE_NAME_FORMAT_STR "/tmp/clr-debug-pipe-%llu-%d-%s"
static void GetPipeName(char *name, DWORD id, const char *suffix)
{
- int chars = _snprintf(name, PATH_MAX, PIPE_NAME_FORMAT_STR, id, suffix);
+ UINT64 uniqueTimeValue;
+ BOOL ret = GetUniqueTimeValueForProcess(id, &uniqueTimeValue);
+
+ // If GetUniqueTimeValueForProcess failed for some reason, it shouldn't have
+ // modified uniqueTimeValue. We expect that anyone else making the pipe name
+ // will also fail and thus will also try to use 0 as the time value.
+ _ASSERTE(ret == TRUE || uniqueTimeValue == 0);
+
+ int chars = _snprintf(name, PATH_MAX, PIPE_NAME_FORMAT_STR, uniqueTimeValue, id, suffix);
_ASSERTE(chars > 0 && chars < PATH_MAX);
}