pkgsrc-WIP-changes archive

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

coreclr-git: Improve patch for fgetpos(3) fsetpos(3)



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Thu Feb 4 23:15:27 2016 +0100
Changeset:	0f0e2c254da568284648a92d369adce1b3329f9e

Modified Files:
	coreclr-git/distinfo
	coreclr-git/patches/patch-src_pal_src_cruntime_file.cpp

Log Message:
coreclr-git: Improve patch for fgetpos(3) fsetpos(3)

Thanks Peter Jas (@jasonwilliams200OK) for hacking session.

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

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

diffstat:
 coreclr-git/distinfo                               |  2 +-
 .../patches/patch-src_pal_src_cruntime_file.cpp    | 37 +++++++++++++++-------
 2 files changed, 26 insertions(+), 13 deletions(-)

diffs:
diff --git a/coreclr-git/distinfo b/coreclr-git/distinfo
index c678457..0a8ee6e 100644
--- a/coreclr-git/distinfo
+++ b/coreclr-git/distinfo
@@ -4,7 +4,7 @@ SHA1 (patch-src_debug_ee_controller.h) = f1a11bdadd82b706d37236cf41d629aee247cd8
 SHA1 (patch-src_debug_ee_debugger.h) = 4f93c0da59999e326bfec29b57a202acf0341309
 SHA1 (patch-src_pal_inc_pal__char16.h) = 205f6a8533838c192b36bbb00155da1b02e0f629
 SHA1 (patch-src_pal_src_CMakeLists.txt) = 7f5b7e7f669efa42fb1bc230949e508a0df080ed
-SHA1 (patch-src_pal_src_cruntime_file.cpp) = 315ad5db53ef2b893a77aa131ce97999214e0e11
+SHA1 (patch-src_pal_src_cruntime_file.cpp) = fc8f878ee82c5013df6114b55fcc2a3af7cdcd04
 SHA1 (patch-src_pal_src_debug_debug.cpp) = 0d6bee5d2896de64effafa01d2e2989de82c76fc
 SHA1 (patch-src_pal_src_exception_seh-unwind.cpp) = 64a221a2f57b6654cae73a2aba0b59daf33b8224
 SHA1 (patch-src_pal_src_exception_signal.cpp) = ba0cabad71792a0108ffd9ec29254751f1e95997
diff --git a/coreclr-git/patches/patch-src_pal_src_cruntime_file.cpp b/coreclr-git/patches/patch-src_pal_src_cruntime_file.cpp
index 39810a5..5322a23 100644
--- a/coreclr-git/patches/patch-src_pal_src_cruntime_file.cpp
+++ b/coreclr-git/patches/patch-src_pal_src_cruntime_file.cpp
@@ -2,21 +2,34 @@ $NetBSD$
 
 --- src/pal/src/cruntime/file.cpp.orig	2016-01-28 19:04:13.000000000 +0000
 +++ src/pal/src/cruntime/file.cpp
-@@ -840,7 +840,7 @@ PAL_fgetpos (
-     PAL_fpos_t *pos
- )
- {
--#ifdef __LINUX__
-+#if defined(__LINUX__) || defined(__NetBSD__)
+@@ -844,6 +844,15 @@ PAL_fgetpos (
      // TODO: implement for Linux if required
      ASSERT(FALSE);
      return -1;
-@@ -886,7 +886,7 @@ PAL_fsetpos (
-     const PAL_fpos_t *pos
- )
- {
--#ifdef __LINUX__
-+#if defined(__LINUX__) || defined(__NetBSD__)
++#elif defined(__NetBSD__)
++    off_t native_pos;
++
++    if ((native_pos = ftello(f->bsdFilePtr)) == -1)
++        return -1;
++
++    *pos = native_pos;
++
++    return 0;
+ #else
+     int    nRetVal = -1;
+     fpos_t native_pos;
+@@ -890,6 +899,14 @@ PAL_fsetpos (
      // TODO: implement for Linux if required
      ASSERT(FALSE);
      return  -1;
++#elif defined(__NetBSD__)
++    off_t native_pos;
++
++    native_pos = *pos;
++    if (fseeko(f->bsdFilePtr, native_pos, SEEK_SET) == -1)
++        return -1;
++
++    return 0;
+ #else
+     int    nRetVal = -1;
+     fpos_t native_pos;


Home | Main Index | Thread Index | Old Index