pkgsrc/x11/xview-lib/patches/patch-cl
abs c9c8f97e88 - Add PKG_DESTDIR_SUPPORT
- Depend on the latest version of xview-config
- Mark as LICENSE sun-openlook-license
- Bump pkgrevision
2009-12-10 20:35:56 +00:00

46 lines
1.5 KiB
Text

$NetBSD: patch-cl,v 1.2 2009/12/10 20:35:57 abs Exp $
--- lib/libxview/ttysw/tty_ntfy.c.orig 1993-06-29 05:17:17.000000000 +0000
+++ lib/libxview/ttysw/tty_ntfy.c
@@ -171,10 +171,14 @@ ttysw_sigwinch(ttysw)
* 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 @@ ttysw_sendsig(ttysw, textsw, sig)
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 @@ ttysw_sendsig(ttysw, textsw, sig)
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"));
}