1a8b68b3a5
Christian Biere in PR 34798 with minor fixes by me. Changes: * Improvements for compatibility with xterm: - Log file handling [kzys] - Function keys [seiichi] (Thanks to Konosuke Watanabe) - Sequence for setting scroll region [seiichi] (Thanks to SHIOTA Shoichi and Takashi SHIRAI) - Behavior of saving/restoring cursor [minami] (Thanks to Thomas Dickey for suggestions) - Termcap and Terminfo [minami, seiichi] - Turn off mouse position reporting by a "reset" sequence [minami] (Debian Bug #55637) * Improvement build prosess for cross-compiling [minami] * Workaround for missing rgb.txt [minami] * Updated documents [kzys, minami, seiichi] * Bug fix for broken selection requester [minami] * Added support for SCIM-1.4.x [seiichi] * Removed support for SCIM-1.0.x [seiichi] * Removed support for uim-0.x.x [seiichi] * Hebrew mapping table for "kbd" input method [seiich] * Revided a scroll caching mechanism [seiichi] (SF Bug #1161050) * Suppressed a check for libxpg4 of FreeBSD [seiichi] (Thanks to SHIOTA Shoichi and MANTANI Nobutaka) * Fixed a bug of alignment of full width chars when variable column width is enabled [minami] (Thanks to Oibane) * Vietnamese translation for mlconfig [Pham Thanh Long] * Other Bug fixes: - SF Bug #1206515 [Takeshi Hakamata] - SF Bug #1161055 [seiichi] - Debian Bug #302231 [Andreas Jochens] - Debian Bug #313970 [Jens Seidel] - Debian Bug #350590 [seiichi] - SUSE Bug #105320 [mfabian]
56 lines
1.3 KiB
Text
56 lines
1.3 KiB
Text
$NetBSD: patch-am,v 1.1 2006/12/19 07:53:57 wiz Exp $
|
|
|
|
plugged fd leaks.
|
|
|
|
http://mlterm.cvs.sourceforge.net/mlterm/mlterm/mlterm/ml_config_menu.c?r1=1.6&r2=1.7&view=patch
|
|
|
|
--- mlterm/ml_config_menu.c.orig 2003/09/16 03:18:31 1.6
|
|
+++ mlterm/ml_config_menu.c 2006/10/19 14:41:51 1.7
|
|
@@ -33,6 +33,7 @@
|
|
if( config_menu->pid == pid)
|
|
{
|
|
config_menu->pid = 0 ;
|
|
+ close( config_menu->fd) ;
|
|
config_menu->fd = -1 ;
|
|
}
|
|
}
|
|
@@ -83,6 +84,12 @@
|
|
return 0 ;
|
|
}
|
|
|
|
+ if( !kik_file_unset_cloexec( pty_fd))
|
|
+ {
|
|
+ /* configulators require an inherited pty. */
|
|
+ return 0 ;
|
|
+ }
|
|
+
|
|
if( pipe( fds) == -1)
|
|
{
|
|
return 0 ;
|
|
@@ -131,8 +138,14 @@
|
|
|
|
close( fds[1]) ;
|
|
|
|
- if( dup2( fds[0] , STDIN_FILENO) == -1 || dup2( pty_fd , STDOUT_FILENO) == -1 ||
|
|
- execv( cmd_path , args) == -1)
|
|
+ /* for configulators,
|
|
+ * STDIN => to read replys from mlterm
|
|
+ * STDOUT => to write the "master" side of pty
|
|
+ * STDERR => is retained to be the mlterm's STDERR
|
|
+ */
|
|
+ if( dup2( fds[0] , STDIN_FILENO) == -1
|
|
+ || dup2( pty_fd , STDOUT_FILENO) == -1
|
|
+ || execv( cmd_path , args) == -1)
|
|
{
|
|
/* failed */
|
|
|
|
@@ -148,6 +161,9 @@
|
|
|
|
config_menu->fd = fds[1] ;
|
|
config_menu->pid = pid ;
|
|
+
|
|
+ kik_file_set_cloexec( pty_fd) ;
|
|
+ kik_file_set_cloexec( config_menu->fd) ;
|
|
|
|
return 1 ;
|
|
}
|