pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/emulators/lrmi Oops, need another #ifdef and a typecas...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cc33e4d10a7a
branches:  trunk
changeset: 462624:cc33e4d10a7a
user:      drochner <drochner%pkgsrc.org@localhost>
date:      Mon Oct 06 11:14:14 2003 +0000

description:
Oops, need another #ifdef and a typecast to make this compile with old
"struct sigaction" declarations. Also clean up bookkeeping whether the
handler is already installed (which didn't work as intended because
SIG_DFL is represented by a zero).

diffstat:

 emulators/lrmi/distinfo         |   4 ++--
 emulators/lrmi/patches/patch-aa |  31 ++++++++++++++++++-------------
 2 files changed, 20 insertions(+), 15 deletions(-)

diffs (110 lines):

diff -r dcd582937439 -r cc33e4d10a7a emulators/lrmi/distinfo
--- a/emulators/lrmi/distinfo   Mon Oct 06 11:02:43 2003 +0000
+++ b/emulators/lrmi/distinfo   Mon Oct 06 11:14:14 2003 +0000
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.2 2003/10/05 13:39:24 drochner Exp $
+$NetBSD: distinfo,v 1.3 2003/10/06 11:14:14 drochner Exp $
 
 SHA1 (lrmi-0.8.tar.gz) = e01ba74b5343551b8d717c2fa9c365cb11d1ab48
 Size (lrmi-0.8.tar.gz) = 9347 bytes
-SHA1 (patch-aa) = 2bb9fd03af21363040715b4471b5bec250663c8f
+SHA1 (patch-aa) = 93dbadd844e48a36ebc77139ca47da3789fb6a41
diff -r dcd582937439 -r cc33e4d10a7a emulators/lrmi/patches/patch-aa
--- a/emulators/lrmi/patches/patch-aa   Mon Oct 06 11:02:43 2003 +0000
+++ b/emulators/lrmi/patches/patch-aa   Mon Oct 06 11:14:14 2003 +0000
@@ -1,7 +1,7 @@
-$NetBSD: patch-aa,v 1.1 2003/10/05 13:39:24 drochner Exp $
+$NetBSD: patch-aa,v 1.2 2003/10/06 11:14:14 drochner Exp $
 
---- lrmi.c.orig        2003-05-14 05:18:12.000000000 +0200
-+++ lrmi.c
+--- lrmi.c.orig        Wed May 14 05:18:12 2003
++++ lrmi.c     Mon Oct  6 13:03:05 2003
 @@ -211,12 +211,26 @@ LRMI_free_real(void *m)
  #define DEFAULT_STACK_SIZE    0x1000
  #define RETURN_TO_32_INT      255
@@ -29,16 +29,17 @@
  #elif defined(__FreeBSD__)
  #define CONTEXT_REGS  context.vm.uc
  #define REG(x)                        uc_mcontext.mc_ ## x
-@@ -237,7 +251,7 @@ static struct {
+@@ -237,7 +251,8 @@ static struct {
  #if defined(__NetBSD__) || defined(__FreeBSD__)
        int success;
        jmp_buf env;
 -      void *old_sighandler;
 +      struct sigaction old_sighandler;
++      int sh_installed;
        int vret;
  #endif
  } context = { 0 };
-@@ -808,10 +822,22 @@ run_vm86(void)
+@@ -808,10 +823,22 @@ run_vm86(void)
  #elif defined(__NetBSD__) || defined(__FreeBSD__)
  #if defined(__NetBSD__)
  static void
@@ -62,7 +63,7 @@
  
        switch (VM86_TYPE(code)) {
                case VM86_INTx:
-@@ -850,7 +876,11 @@ vm86_callback(int sig, int code, struct 
+@@ -850,7 +877,11 @@ vm86_callback(int sig, int code, struct 
        }
  
        /* ...and sync our context back to the kernel. */
@@ -74,7 +75,7 @@
  }
  #elif defined(__FreeBSD__)
  static void
-@@ -899,21 +929,28 @@ vm86_callback(int sig, int code, struct 
+@@ -899,34 +930,44 @@ vm86_callback(int sig, int code, struct 
  static int
  run_vm86(void)
  {
@@ -82,7 +83,7 @@
 +      struct sigaction sa;
 +      int res;
 +
-+      if (context.old_sighandler.sa_sigaction) {
++      if (context.sh_installed) {
  #ifdef LRMI_DEBUG
                fprintf(stderr, "run_vm86: callback already installed\n");
  #endif
@@ -90,12 +91,14 @@
        }
  
 +      memset(&sa, 0, sizeof(sa));
++#if defined(__NetBSD__) && defined(SA_SIGINFO)
 +      sa.sa_sigaction = vm86_callback;
++      sa.sa_flags = SA_SIGINFO;
++#else
++      sa.sa_handler = (void (*)(int))vm86_callback;
++#endif
  #if defined(__NetBSD__)
 -      context.old_sighandler = signal(SIGURG, (void (*)(int))vm86_callback);
-+#if defined(SA_SIGINFO)
-+      sa.sa_flags = SA_SIGINFO;
-+#endif
 +      res = sigaction(SIGURG, &sa, &context.old_sighandler);
  #elif defined(__FreeBSD__)
 -      context.old_sighandler = signal(SIGBUS, (void (*)(int))vm86_callback);
@@ -108,7 +111,9 @@
  #ifdef LRMI_DEBUG
                fprintf(stderr, "run_vm86: cannot install callback\n");
  #endif
-@@ -922,11 +959,11 @@ run_vm86(void)
+               return (0);
+       }
++      context.sh_installed = 1;
  
        if (setjmp(context.env)) {
  #if defined(__NetBSD__)
@@ -119,7 +124,7 @@
 +              sigaction(SIGBUS, &context.old_sighandler, 0);
  #endif
 -              context.old_sighandler = NULL;
-+              context.old_sighandler.sa_sigaction = NULL;
++              context.sh_installed = 0;
  
                if (context.success)
                        return (1);



Home | Main Index | Thread Index | Old Index