pkgsrc/misc/lv/patches/patch-ab
obache e3a3ced090 Some improvements:
* set LICENSE=gnu-gpl-v2
* add user-destdir support
* reset WRKSRC setting, use CONFIGURE_DIRS instead,
  so that pkgsrc magick affect to all files
* regen patches, split out patch-ad from patch-ac
  (one patch file to multiple files is not good).
* need termcap to build.
2010-02-10 10:43:28 +00:00

46 lines
1.1 KiB
Text

$NetBSD: patch-ab,v 1.2 2010/02/10 10:43:28 obache Exp $
--- src/console.c.orig 2004-01-05 07:27:46.000000000 +0000
+++ src/console.c
@@ -388,7 +388,22 @@ public void ConsoleSetUp()
signal( SIGINT, InterruptIgnoreHandler );
#endif /* MSDOS */
-#ifdef HAVE_SIGVEC
+#ifdef HAVE_SIGACTION
+ struct sigaction sa;
+
+ sigemptyset( &sa.sa_mask );
+# ifndef SA_RESTART
+ sa.sa_flags = 0;
+# else
+ sa.sa_flags = SA_RESTART;
+# endif
+ sa.sa_handler = WindowChangeHandler;
+ (void)sigaction( SIGWINCH, &sa, NULL );
+
+ sa.sa_handler = InterruptHandler;
+ (void)sigaction( SIGINT, &sa, NULL );
+#else
+# ifdef SV_INTERRUPT
struct sigvec sigVec;
sigVec.sv_handler = WindowChangeHandler;
@@ -400,12 +415,13 @@ public void ConsoleSetUp()
sigVec.sv_mask = sigmask( SIGINT );
sigVec.sv_flags = SV_INTERRUPT;
sigvec( SIGINT, &sigVec, NULL );
-#else
-# ifdef SIGWINCH
+# else
+# ifdef SIGWINCH
signal( SIGWINCH, WindowChangeHandler );
-# endif
+# endif
signal( SIGINT, InterruptHandler );
-#endif /* HAVE_SIGVEC */
+# endif /* SV_INTERRUPT */
+#endif /* HAVE_SIGACTION */
#ifdef UNIX
#ifdef HAVE_TERMIOS_H