summaryrefslogtreecommitdiff
path: root/x11/mlterm/patches/patch-ao
blob: 4cc77582bfd23bb8d625ce57aa41b589dc1ac532 (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
$NetBSD: patch-ao,v 1.1 2006/12/19 07:53:57 wiz Exp $

plugged fd leaks.

http://mlterm.cvs.sourceforge.net/mlterm/mlterm/xwindow/x_term_manager.c?r1=1.93&r2=1.95&view=patch

--- xwindow/x_term_manager.c.orig	2006/09/30 16:09:44	1.93
+++ xwindow/x_term_manager.c	2006/11/20 11:22:34	1.95
@@ -872,7 +872,8 @@
 	{
 		return  -1 ;
 	}
-
+	kik_file_set_cloexec( sock_fd);
+	
 	while( bind( sock_fd , (struct sockaddr *) &servaddr , sizeof( servaddr)) < 0)
 	{
 		if( errno == EADDRINUSE)
@@ -993,7 +994,7 @@
 	 * If this flag off, this fd remained open until the child process forked in
 	 * open_screen_intern()(ml_term_open_pty()) close it.
 	 */
-	fcntl( fd , F_SETFD , 1) ;
+	kik_file_set_cloexec( fd) ;
 
 	if( ( fp = fdopen( fd , "r+")) == NULL)
 	{
@@ -1855,6 +1856,7 @@
 		{
 			additional_fds[i].fd = fd ;
 			additional_fds[i].handler = handler ;
+			kik_file_set_cloexec( fd);
 
 			return  0 ;
 		}