pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/emulators/hercules4sdl emulators/hercules4sdl: add pat...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/507168352aa1
branches:  trunk
changeset: 389980:507168352aa1
user:      rhialto <rhialto%pkgsrc.org@localhost>
date:      Tue Dec 13 18:41:52 2022 +0000

description:
emulators/hercules4sdl: add patch from upstream for networking crash

Fix issue https://github.com/SDL-Hercules-390/hyperion/issues/525
which can cause a segfault if networking is used.
Created a patch file from an upstream commit, therefore it patches multiple
files. It should be possible to remove it at the next release.

diffstat:

 emulators/hercules4sdl/Makefile                |    3 +-
 emulators/hercules4sdl/distinfo                |    3 +-
 emulators/hercules4sdl/patches/patch-issue-525 |  121 +++++++++++++++++++++++++
 3 files changed, 125 insertions(+), 2 deletions(-)

diffs (150 lines):

diff -r 692c69a60531 -r 507168352aa1 emulators/hercules4sdl/Makefile
--- a/emulators/hercules4sdl/Makefile   Tue Dec 13 17:54:07 2022 +0000
+++ b/emulators/hercules4sdl/Makefile   Tue Dec 13 18:41:52 2022 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.9 2022/11/27 15:43:13 rhialto Exp $
+# $NetBSD: Makefile,v 1.10 2022/12/13 18:41:52 rhialto Exp $
 
 PKGNAME=       hercules4sdl-4.5
+PKGREVISION=   1
 DISTNAME=      hyperion-Release_${PKGVERSION_NOREV}
 CATEGORIES=    emulators
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=SDL-Hercules-390/}
diff -r 692c69a60531 -r 507168352aa1 emulators/hercules4sdl/distinfo
--- a/emulators/hercules4sdl/distinfo   Tue Dec 13 17:54:07 2022 +0000
+++ b/emulators/hercules4sdl/distinfo   Tue Dec 13 18:41:52 2022 +0000
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.5 2022/11/27 15:43:13 rhialto Exp $
+$NetBSD: distinfo,v 1.6 2022/12/13 18:41:52 rhialto Exp $
 
 BLAKE2s (hyperion-Release_4.5.tar.gz) = 2e39391bdfcd789f46e247e74a108fafbab82da8cae6fad4ee6bf8ae13ea5aa1
 SHA512 (hyperion-Release_4.5.tar.gz) = 8129bd9129bd8aa1323cf9caa166eabbfe2f9fd2ac93bfc411060ee7d5bd81b1e4f489c816a2ce55a5d4e69f4658d87eae8c534fa5581ef2c951768be43e6be0
 Size (hyperion-Release_4.5.tar.gz) = 24271753 bytes
 SHA1 (patch-Makefile.am) = 6ae600095ffb29aab2a5e1e467f79a40e814f26d
 SHA1 (patch-configure.ac) = 734f64da8f4ce0f790d4eac0f352649d1b6d08f2
+SHA1 (patch-issue-525) = 6ec2b5cb760da92ca667bc3f29317bdf770fcbe0
diff -r 692c69a60531 -r 507168352aa1 emulators/hercules4sdl/patches/patch-issue-525
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/hercules4sdl/patches/patch-issue-525    Tue Dec 13 18:41:52 2022 +0000
@@ -0,0 +1,121 @@
+$NetBSD: patch-issue-525,v 1.1 2022/12/13 18:41:52 rhialto Exp $
+
+Cherry-pick from
+https://github.com/SDL-Hercules-390/hyperion/commit/2e2e942fb38f43842e8a9e2800aa42c346bfb050.patch
+
+From 2e2e942fb38f43842e8a9e2800aa42c346bfb050 Mon Sep 17 00:00:00 2001
+From: Bill Lewis <wrljet%gmail.com@localhost>
+Date: Sat, 10 Dec 2022 12:15:20 -0500
+Subject: [PATCH] Fix for Issue #525
+
+Don't issue messages when setting the CODEPAGE from Hercifc, as they can wind up in the stream, corrupting data exchange with Hercules.
+---
+ codepage.c | 36 ++++++++++++++++++++++++++----------
+ codepage.h |  1 +
+ hercifc.c  |  2 +-
+ tuntap.c   |  2 +-
+ 4 files changed, 29 insertions(+), 12 deletions(-)
+
+diff --git a/codepage.c b/codepage.c
+index 4c3325ad1..7e507e245 100644
+--- codepage.c
++++ codepage.c
+@@ -1076,7 +1076,10 @@ DLL_EXPORT bool valid_codepage_name( const char* name )
+     return false;
+ }
+ 
+-DLL_EXPORT void set_codepage( const char* name )
++#define SETCODEPAGE_SILENT   1
++#define SETCODEPAGE_VERBOSE  2
++
++static void set_codepage_internal( const char* name, int msgflag )
+ {
+     int dflt = FALSE;
+ 
+@@ -1089,7 +1092,7 @@ DLL_EXPORT void set_codepage( const char* name )
+ 
+     if( strcasecmp(name,"user") == 0 && user_in_use == FALSE )
+     {
+-        WRMSG( HHC01477, "W" );
++        if( msgflag == SETCODEPAGE_VERBOSE) WRMSG( HHC01477, "W" );
+         name = "default";
+     }
+ 
+@@ -1100,18 +1103,31 @@ DLL_EXPORT void set_codepage( const char* name )
+     if( codepage_conv->name && strcasecmp(codepage_conv->name,"user") == 0 && user_in_use == FALSE )
+         codepage_conv++;
+ 
+-    if(codepage_conv->name)
+-    {
+-        if (!dflt)
+-            WRMSG(HHC01474, "I", "internal", name);
+-    }
+-    else
++    if( msgflag == SETCODEPAGE_VERBOSE )
+     {
+-        if (!dflt)
+-            WRMSG (HHC01475, "E", name);
++        if(codepage_conv->name)
++        {
++            if (!dflt)
++                WRMSG(HHC01474, "I", "internal", name);
++        }
++        else
++        {
++            if (!dflt)
++                WRMSG (HHC01475, "E", name);
++        }
+     }
+ }
+ 
++DLL_EXPORT void set_codepage( const char* name )
++{
++    set_codepage_internal( name, SETCODEPAGE_VERBOSE );
++}
++
++DLL_EXPORT void set_codepage_no_msgs( const char* name )
++{
++    set_codepage_internal( name, SETCODEPAGE_SILENT );
++}
++
+ DLL_EXPORT int update_codepage(int argc, char *argv[], char *cmd )
+ {
+     int rc = 0;
+diff --git a/codepage.h b/codepage.h
+index 7e4edbc98..a44a58d14 100644
+--- codepage.h
++++ codepage.h
+@@ -14,6 +14,7 @@
+ COD_DLL_IMPORT const char* query_codepage();
+ COD_DLL_IMPORT bool valid_codepage_name( const char* name );
+ COD_DLL_IMPORT void set_codepage( const char *name);
++COD_DLL_IMPORT void set_codepage_no_msgs( const char* name );
+ COD_DLL_IMPORT int update_codepage(int argc, char *argv[], char *table );
+ COD_DLL_IMPORT unsigned char host_to_guest (unsigned char byte);
+ COD_DLL_IMPORT unsigned char guest_to_host (unsigned char byte);
+diff --git a/hercifc.c b/hercifc.c
+index d8260d247..1e2ceebc9 100644
+--- hercifc.c
++++ hercifc.c
+@@ -62,7 +62,7 @@ int main( int argc, char **argv )
+         sysblk.msglvl = atoi( argv[1] );
+ 
+         if (argv[2])
+-            set_codepage( argv[2] );
++            set_codepage_no_msgs( argv[2] );
+     }
+ 
+     // Must not be run from the commandline
+diff --git a/tuntap.c b/tuntap.c
+index 90708f087..11ddae78a 100644
+--- tuntap.c
++++ tuntap.c
+@@ -222,7 +222,7 @@ static int TUNTAP_SetMode (int fd, struct hifr *hifr, int iFlags)
+ // Output:
+ //      pfd            Pointer to receive the file descriptor of the
+ //                       TUN/TAP interface.
+-//      pszNetDevName  Pointer to receive the name if the interface.
++//      pszNetDevName  Pointer to receive the name of the interface.
+ 
+ int             TUNTAP_CreateInterface( char* pszTUNDevice,
+                                         int   iFlags,



Home | Main Index | Thread Index | Old Index