OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "nacl_io/mount_node_tty.h" | 5 #include "nacl_io/mount_node_tty.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <signal.h> | 9 #include <signal.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // This ioctl is used to deliver data from the user to this tty node's | 250 // This ioctl is used to deliver data from the user to this tty node's |
251 // input buffer. | 251 // input buffer. |
252 struct tioc_nacl_input_string* message = | 252 struct tioc_nacl_input_string* message = |
253 va_arg(args, struct tioc_nacl_input_string*); | 253 va_arg(args, struct tioc_nacl_input_string*); |
254 return ProcessInput(message); | 254 return ProcessInput(message); |
255 } | 255 } |
256 case TIOCSWINSZ: { | 256 case TIOCSWINSZ: { |
257 struct winsize* size = va_arg(args, struct winsize*); | 257 struct winsize* size = va_arg(args, struct winsize*); |
258 { | 258 { |
259 AUTO_LOCK(node_lock_); | 259 AUTO_LOCK(node_lock_); |
| 260 if (rows_ == size->ws_row && cols_ == size->ws_col) |
| 261 return 0; |
260 rows_ = size->ws_row; | 262 rows_ = size->ws_row; |
261 cols_ = size->ws_col; | 263 cols_ = size->ws_col; |
262 } | 264 } |
263 kill(getpid(), SIGWINCH); | 265 kill(getpid(), SIGWINCH); |
264 { | 266 { |
265 // Wake up any thread waiting on Read with POLLERR then immediate | 267 // Wake up any thread waiting on Read with POLLERR then immediate |
266 // clear it to signal EINTR. | 268 // clear it to signal EINTR. |
267 AUTO_LOCK(emitter_->GetLock()) | 269 AUTO_LOCK(emitter_->GetLock()) |
268 emitter_->RaiseEvents_Locked(POLLERR); | 270 emitter_->RaiseEvents_Locked(POLLERR); |
269 emitter_->ClearEvents_Locked(POLLERR); | 271 emitter_->ClearEvents_Locked(POLLERR); |
(...skipping 18 matching lines...) Expand all Loading... |
288 } | 290 } |
289 | 291 |
290 Error MountNodeTty::Tcsetattr(int optional_actions, | 292 Error MountNodeTty::Tcsetattr(int optional_actions, |
291 const struct termios *termios_p) { | 293 const struct termios *termios_p) { |
292 AUTO_LOCK(node_lock_); | 294 AUTO_LOCK(node_lock_); |
293 termios_ = *termios_p; | 295 termios_ = *termios_p; |
294 return 0; | 296 return 0; |
295 } | 297 } |
296 | 298 |
297 } | 299 } |
OLD | NEW |