aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-05-10 18:46:33 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2009-05-10 18:46:33 +1000
commit1fa419fb3c7ef91e878398bb0388854d27d7bd8f (patch)
tree8ac0a1e2872d2e470c98493df2561bfbf0a21e31
parent4e979dee506fdcf43684b55ecc52b9a2fd1dd2c1 (diff)
downloadbusybox-w32-1fa419fb3c7ef91e878398bb0388854d27d7bd8f.tar.gz
busybox-w32-1fa419fb3c7ef91e878398bb0388854d27d7bd8f.tar.bz2
busybox-w32-1fa419fb3c7ef91e878398bb0388854d27d7bd8f.zip
cygwin_tc?etattr(): dont do anything if failed to detect Cygwin tty
-rw-r--r--libbb/termios.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/termios.c b/libbb/termios.c
index c05bb6dbb..1291bf785 100644
--- a/libbb/termios.c
+++ b/libbb/termios.c
@@ -169,6 +169,8 @@ static int cygwin_tcgetattr(int fd, struct termios *t)
169{ 169{
170 int tty = fd_to_tty(fd); 170 int tty = fd_to_tty(fd);
171 struct shared_info *si = get_shared_info(); 171 struct shared_info *si = get_shared_info();
172 if (tty < 0 || !si)
173 return -1;
172 *t = si->tty.ttys[tty].tty_min.ti; 174 *t = si->tty.ttys[tty].tty_min.ti;
173 return 0; 175 return 0;
174} 176}
@@ -177,11 +179,9 @@ static int cygwin_tcgetattr(int fd, struct termios *t)
177static int cygwin_tcsetattr(int fd, int mode, const struct termios *t) 179static int cygwin_tcsetattr(int fd, int mode, const struct termios *t)
178{ 180{
179 int tty = fd_to_tty(fd); 181 int tty = fd_to_tty(fd);
180 struct shared_info *si; 182 struct shared_info *si = get_shared_info();
181 183 if (tty < 0 || !si)
182 if (tty < 0)
183 return -1; 184 return -1;
184 si = get_shared_info();
185 si->tty.ttys[tty].tty_min.ti = *t; 185 si->tty.ttys[tty].tty_min.ti = *t;
186 return 0; 186 return 0;
187} 187}