mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	A couple of close-on-exec flags.
This commit is contained in:
		
							
								
								
									
										4
									
								
								server.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								server.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: server.c,v 1.33 2007-10-24 11:21:29 nicm Exp $ */
 | 
			
		||||
/* $Id: server.c,v 1.34 2007-10-24 11:30:02 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -105,6 +105,8 @@ server_start(char *path)
 | 
			
		||||
		fatal("fcntl failed");
 | 
			
		||||
	if (fcntl(fd, F_SETFL, mode|O_NONBLOCK) == -1)
 | 
			
		||||
		fatal("fcntl failed");
 | 
			
		||||
	if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
 | 
			
		||||
		fatal("fcntl failed");		
 | 
			
		||||
 | 
			
		||||
	if (daemon(1, 1) != 0)
 | 
			
		||||
		fatal("daemon failed");
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								window.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: window.c,v 1.21 2007-10-23 11:25:32 nicm Exp $ */
 | 
			
		||||
/* $Id: window.c,v 1.22 2007-10-24 11:30:02 nicm Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -89,6 +89,8 @@ window_create(
 | 
			
		||||
		fatal("fcntl failed");
 | 
			
		||||
	if (fcntl(fd, F_SETFL, mode|O_NONBLOCK) == -1)
 | 
			
		||||
		fatal("fcntl failed");
 | 
			
		||||
	if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
 | 
			
		||||
		fatal("fcntl failed");		
 | 
			
		||||
 | 
			
		||||
	mode = 1;
 | 
			
		||||
	if (ioctl(fd, TIOCPKT, &mode) == -1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user