pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

coreclr-git: Fix recent regression and snprintf(3) usage



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Feb 18 23:40:44 2016 +0100
Changeset:	1b19418149e913b201f61ea24f2f5202ffa8ea9c

Modified Files:
	coreclr-git/distinfo
Added Files:
	coreclr-git/patches/patch-src_debug_debug-pal_unix_twowaypipe.cpp
	coreclr-git/patches/patch-src_debug_debug-pal_unix_windefs.h
	coreclr-git/patches/patch-src_pal_inc_pal.h

Log Message:
coreclr-git: Fix recent regression and snprintf(3) usage

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=1b19418149e913b201f61ea24f2f5202ffa8ea9c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 coreclr-git/distinfo                               |  3 +
 .../patch-src_debug_debug-pal_unix_twowaypipe.cpp  | 97 ++++++++++++++++++++++
 .../patch-src_debug_debug-pal_unix_windefs.h       | 17 ++++
 coreclr-git/patches/patch-src_pal_inc_pal.h        | 12 +++
 4 files changed, 129 insertions(+)

diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index afc7651..9146bf2 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -1,2 +1,5 @@
 $NetBSD$
 
+SHA1 (patch-src_debug_debug-pal_unix_twowaypipe.cpp) = 8a5b3353b1072ba96c1350f88cc2d4bcbd235b0f
+SHA1 (patch-src_debug_debug-pal_unix_windefs.h) = e84f4cee35d4a62cd121479e4a53a8ee1938df5c
+SHA1 (patch-src_pal_inc_pal.h) = 7d3ef148af8b1b24067ba4cb5efc12581ebc6881
diff --git a/coreclr-git/patches/patch-src_debug_debug-pal_unix_twowaypipe.cpp b/coreclr-git/patches/patch-src_debug_debug-pal_unix_twowaypipe.cpp
new file mode 100644
index 0000000..d2aa8e2
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_debug-pal_unix_twowaypipe.cpp
@@ -0,0 +1,97 @@
+$NetBSD$
+
+--- src/debug/debug-pal/unix/twowaypipe.cpp.orig	2016-02-18 21:11:19.000000000 +0000
++++ src/debug/debug-pal/unix/twowaypipe.cpp
+@@ -2,22 +2,21 @@
+ // The .NET Foundation licenses this file to you under the MIT license.
+ // See the LICENSE file in the project root for more information.
+ 
+-#include <pal.h>
+-
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <stdio.h>
+ #include <limits.h>
+-#include <pal_assert.h>
+ 
++#include "windefs.h"
+ #include "twowaypipe.h"
+ 
+ #define PIPE_NAME_FORMAT_STR "/tmp/clr-debug-pipe-%d-%s"
+ 
+ static void GetPipeName(char *name, DWORD id, const char *suffix)
+ {
+-    int chars = _snprintf(name, PATH_MAX, PIPE_NAME_FORMAT_STR, id, suffix);
++    int chars = snprintf(name, PATH_MAX, PIPE_NAME_FORMAT_STR, id, suffix);
+     _ASSERTE(chars > 0 && chars < PATH_MAX);
+ }
+ 
+@@ -43,14 +42,15 @@ bool TwoWayPipe::CreateServer(DWORD id)
+ 
+     if (mkfifo(outPipeName, S_IRWXU) == -1)
+     {
+-        unlink(inPipeName);
++        remove(inPipeName);
+         return false;
+-    }
++    }    
+ 
+     m_state = Created;
+     return true;
+ }
+ 
++
+ // Connects to a previously opened server side of the pipe.
+ // Id is used to locate the pipe on the machine. 
+ // true - success, false - failure (use GetLastError() for more details)
+@@ -138,7 +138,6 @@ int TwoWayPipe::Read(void *buffer, DWORD
+         {
+             break;
+         }
+-
+         buffer = (char*)buffer + bytesRead;
+         cb -= bytesRead;
+     }
+@@ -165,7 +164,6 @@ int TwoWayPipe::Write(const void *data, 
+         {
+             break;
+         }
+-
+         data = (char*)data + bytesWritten;
+         cb -= bytesWritten;
+     }
+@@ -177,6 +175,7 @@ int TwoWayPipe::Write(const void *data, 
+ // true - success, false - failure (use GetLastError() for more details)
+ bool TwoWayPipe::Disconnect()
+ {
++
+     if (m_outboundPipe != INVALID_PIPE && m_outboundPipe != 0)
+     {
+         close(m_outboundPipe);
+@@ -187,19 +186,21 @@ bool TwoWayPipe::Disconnect()
+     {
+         close(m_inboundPipe);
+         m_inboundPipe = INVALID_PIPE;
+-    }
++    }    
+ 
+     if (m_state == ServerConnected || m_state == Created)
+     {
++
+         char inPipeName[PATH_MAX];
+         GetPipeName(inPipeName, m_id, "in");
+-        unlink(inPipeName);
++        remove(inPipeName);
+ 
+         char outPipeName[PATH_MAX];
+         GetPipeName(outPipeName, m_id, "out");
+-        unlink(outPipeName);
++        remove(outPipeName);
+     }
+ 
+     m_state = NotInitialized;
+     return true;
+ }
++
diff --git a/coreclr-git/patches/patch-src_debug_debug-pal_unix_windefs.h b/coreclr-git/patches/patch-src_debug_debug-pal_unix_windefs.h
new file mode 100644
index 0000000..0a64e40
--- /dev/null
+++ b/coreclr-git/patches/patch-src_debug_debug-pal_unix_windefs.h
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- src/debug/debug-pal/unix/windefs.h.orig	2016-02-18 22:12:18.171417621 +0000
++++ src/debug/debug-pal/unix/windefs.h
+@@ -0,0 +1,12 @@
++// Licensed to the .NET Foundation under one or more agreements.
++// The .NET Foundation licenses this file to you under the MIT license.
++// See the LICENSE file in the project root for more information.
++
++// It'd be nice to be able to include some existing header from the main PAL, 
++// but they tend to pull too much stuff that breaks everything.
++
++#include <cstddef>
++#include <assert.h>
++#define _ASSERTE assert
++
++typedef unsigned int DWORD;
diff --git a/coreclr-git/patches/patch-src_pal_inc_pal.h b/coreclr-git/patches/patch-src_pal_inc_pal.h
new file mode 100644
index 0000000..96477cf
--- /dev/null
+++ b/coreclr-git/patches/patch-src_pal_inc_pal.h
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- src/pal/inc/pal.h.orig	2016-02-18 21:11:19.000000000 +0000
++++ src/pal/inc/pal.h
+@@ -6050,6 +6050,7 @@ CoCreateGuid(OUT GUID * pguid);
+ #define _close        PAL__close
+ #define _wcstoui64    PAL__wcstoui64
+ #define _flushall     PAL__flushall
++#define _vsnprintf    PAL__vsnprintf
+ 
+ #ifdef _AMD64_ 
+ #define _mm_getcsr    PAL__mm_getcsr


Home | Main Index | Thread Index | Old Index