* fhandler_tty.cc (fhandler_pty_slave::write): Fix potential exit from loop

with write mutex held.  Delete redundant mutex release.  Clear tty error once
we've grabbed it.
This commit is contained in:
Christopher Faylor
2012-10-15 17:12:17 +00:00
parent b0b441fcef
commit 2c9cefa586
3 changed files with 11 additions and 1 deletions

View File

@@ -663,6 +663,8 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
{
set_errno (get_ttyp ()->write_error);
towrite = (DWORD) -1;
get_ttyp ()->write_error = 0;
release_output_mutex ();
break;
}
@@ -681,7 +683,6 @@ fhandler_pty_slave::write (const void *ptr, size_t len)
}
raise (SIGHUP); /* FIXME: Should this be SIGTTOU? */
towrite = (DWORD) -1;
release_output_mutex ();
break;
}
}