mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Don't try to use tio if it is NULL.
This commit is contained in:
		@@ -1,4 +1,4 @@
 | 
				
			|||||||
/* $Id: forkpty-aix.c,v 1.3 2009-08-19 16:06:45 nicm Exp $ */
 | 
					/* $Id: forkpty-aix.c,v 1.4 2009-09-20 18:31:16 nicm Exp $ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -70,7 +70,7 @@ forkpty(int *master, unused char *name, struct termios *tio, struct winsize *ws)
 | 
				
			|||||||
			fatal("open failed");
 | 
								fatal("open failed");
 | 
				
			||||||
		close(fd);
 | 
							close(fd);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (tcsetattr(slave, TCSAFLUSH, tio) == -1)
 | 
							if (tio != NULL && tcsetattr(slave, TCSAFLUSH, tio) == -1)
 | 
				
			||||||
			fatal("tcsetattr failed");
 | 
								fatal("tcsetattr failed");
 | 
				
			||||||
		if (ioctl(slave, TIOCSWINSZ, ws) == -1)
 | 
							if (ioctl(slave, TIOCSWINSZ, ws) == -1)
 | 
				
			||||||
			fatal("ioctl failed");
 | 
								fatal("ioctl failed");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
/* $Id: forkpty-sunos.c,v 1.7 2009-08-19 16:06:45 nicm Exp $ */
 | 
					/* $Id: forkpty-sunos.c,v 1.8 2009-09-20 18:31:16 nicm Exp $ */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
					 * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
				
			||||||
@@ -62,7 +62,7 @@ forkpty(int *master, unused char *name, struct termios *tio, struct winsize *ws)
 | 
				
			|||||||
		if (ioctl(slave, I_PUSH, "ldterm") == -1)
 | 
							if (ioctl(slave, I_PUSH, "ldterm") == -1)
 | 
				
			||||||
			fatal("ioctl failed");
 | 
								fatal("ioctl failed");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (tcsetattr(slave, TCSAFLUSH, tio) == -1)
 | 
							if (tio != NULL && tcsetattr(slave, TCSAFLUSH, tio) == -1)
 | 
				
			||||||
			fatal("tcsetattr failed");
 | 
								fatal("tcsetattr failed");
 | 
				
			||||||
		if (ioctl(slave, TIOCSWINSZ, ws) == -1)
 | 
							if (ioctl(slave, TIOCSWINSZ, ws) == -1)
 | 
				
			||||||
			fatal("ioctl failed");
 | 
								fatal("ioctl failed");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user