diff options
author | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-18 16:32:34 +0000 |
---|---|---|
committer | sbc@chromium.org <sbc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-18 16:32:34 +0000 |
commit | ee533bd6d43fed338d4a8e23d1417b8096c1f48f (patch) | |
tree | ed9aee36a302bbff7ecc0fcc63ee433786ad9b5f /native_client_sdk | |
parent | 07597bf344cfea50d6ed40a67a3ccf89f44d8ea6 (diff) | |
download | chromium_src-ee533bd6d43fed338d4a8e23d1417b8096c1f48f.zip chromium_src-ee533bd6d43fed338d4a8e23d1417b8096c1f48f.tar.gz chromium_src-ee533bd6d43fed338d4a8e23d1417b8096c1f48f.tar.bz2 |
[NaCl SDK] nacl_io: On SIGWINCH don't interrupt calls to read(2)
On linux at least its only select/poll that error out
with EINTR when such signals arrive, not read/write.
This was causing nethack to exit on startup.
R=binji@chromium.org, binji
Review URL: https://codereview.chromium.org/23926020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223889 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r-- | native_client_sdk/src/libraries/nacl_io/mount_node_tty.cc | 15 | ||||
-rw-r--r-- | native_client_sdk/src/libraries/nacl_io/mount_node_tty.h | 1 |
2 files changed, 0 insertions, 16 deletions
diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_tty.cc b/native_client_sdk/src/libraries/nacl_io/mount_node_tty.cc index 534e53a..5a2fc7a 100644 --- a/native_client_sdk/src/libraries/nacl_io/mount_node_tty.cc +++ b/native_client_sdk/src/libraries/nacl_io/mount_node_tty.cc @@ -34,7 +34,6 @@ namespace nacl_io { MountNodeTty::MountNodeTty(Mount* mount) : MountNodeCharDevice(mount), is_readable_(false), - did_resize_(false), rows_(DEFAULT_TTY_ROWS), cols_(DEFAULT_TTY_COLS) { output_handler_.handler = NULL; @@ -100,15 +99,8 @@ Error MountNodeTty::Write(size_t offs, Error MountNodeTty::Read(size_t offs, void* buf, size_t count, int* out_bytes) { AUTO_LOCK(node_lock_); - did_resize_ = false; while (!is_readable_) { pthread_cond_wait(&is_readable_cond_, node_lock_.mutex()); - if (!is_readable_ && did_resize_) { - // If an async resize event occured then return the failure and - // set EINTR. - *out_bytes = 0; - return EINTR; - } } size_t bytes_to_copy = std::min(count, input_buffer_.size()); @@ -259,13 +251,6 @@ Error MountNodeTty::Ioctl(int request, char* arg) { cols_ = size->ws_col; } kill(getpid(), SIGWINCH); - - // Wake up any thread waiting on Read - { - AUTO_LOCK(node_lock_); - did_resize_ = true; - pthread_cond_broadcast(&is_readable_cond_); - } return 0; } case TIOCGWINSZ: { diff --git a/native_client_sdk/src/libraries/nacl_io/mount_node_tty.h b/native_client_sdk/src/libraries/nacl_io/mount_node_tty.h index 8bf5b17..c8070b9 100644 --- a/native_client_sdk/src/libraries/nacl_io/mount_node_tty.h +++ b/native_client_sdk/src/libraries/nacl_io/mount_node_tty.h @@ -53,7 +53,6 @@ class MountNodeTty : public MountNodeCharDevice { std::deque<char> input_buffer_; bool is_readable_; - bool did_resize_; pthread_cond_t is_readable_cond_; struct termios termios_; |