summaryrefslogtreecommitdiff
path: root/x11/xview-lib/patches/patch-cl
blob: 25cdf7269f81a1b4037e7e51d8fce774f0285ae8 (plain)
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-cl,v 1.1 2001/12/20 09:20:03 tron Exp $

--- lib/libxview/ttysw/tty_ntfy.c.orig	Tue Jun 29 07:17:17 1993
+++ lib/libxview/ttysw/tty_ntfy.c	Thu Dec 20 10:09:17 2001
@@ -171,10 +171,14 @@
      * SIGWINCHes on resize.
      */
     /* Notify process group that terminal has changed. */
+#if !(defined(BSD) && (BSD >= 199103))
     if (ioctl(ttysw->ttysw_tty, TIOCGPGRP, &pgrp) == -1) {
 	perror(XV_MSG("ttysw_sigwinch, can't get tty process group"));
 	return;
     }
+#else
+    pgrp = tcgetpgrp(ttysw->ttysw_pty);
+#endif
     /*
      * Only killpg when pgrp is not tool's.  This is the case of haven't
      * completed ttysw_fork yet (or even tried to do it yet).
@@ -204,7 +208,11 @@
 	return;
     }
     /* Send the signal to the process group of the controlling tty */
+#if !(defined(BSD) && (BSD >= 199103))
     if (ioctl(ttysw->ttysw_tty, TIOCGPGRP, &control_pg) >= 0) {
+#else
+    if ((control_pg = tcgetpgrp(ttysw->ttysw_pty)) >= 0) {
+#endif
 	/*
 	 * Flush our buffers of completed and partial commands. Be sure to do
 	 * this BEFORE killpg, or we'll flush the prompt coming back from the
@@ -227,11 +235,11 @@
 	    termsw->cmd_started = 0;
 	    termsw->pty_owes_newline = 0;
 	}
-#	if defined(XV_USE_SVR4_PTYS) || defined(sun)
+#if defined(XV_USE_SVR4_PTYS) || defined(sun)
 	(void) ioctl(ttysw->ttysw_pty, TIOCSIGNAL, &sig);;
-#	else
+#else
 	(void) killpg(control_pg, sig);
-#	endif
+#endif
     } else
 	perror(XV_MSG("ioctl"));
 }