1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
$NetBSD: patch-ab,v 1.1 2005/12/03 16:46:32 christos Exp $
--- ../src/console.c.orig 2004-01-05 02:27:46.000000000 -0500
+++ ../src/console.c 2005-12-03 11:37:19.000000000 -0500
@@ -388,7 +388,22 @@
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 @@
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
|