aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/unix
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2015-09-15 15:23:56 +0200
committerLukas Larsson <[email protected]>2015-09-16 13:34:36 +0200
commit11cf60809a26155c7904771974739f4a51911c93 (patch)
tree3cb813dfc28c5a3511fa755d125530732c9d1aa0 /erts/emulator/drivers/unix
parent6b4c2dbd1b4a30f421611987acec6315c62ac9d5 (diff)
downloadotp-11cf60809a26155c7904771974739f4a51911c93.tar.gz
otp-11cf60809a26155c7904771974739f4a51911c93.tar.bz2
otp-11cf60809a26155c7904771974739f4a51911c93.zip
erts: Make sure to deal with EINTR write failures
Diffstat (limited to 'erts/emulator/drivers/unix')
-rw-r--r--erts/emulator/drivers/unix/ttsl_drv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/erts/emulator/drivers/unix/ttsl_drv.c b/erts/emulator/drivers/unix/ttsl_drv.c
index 53146e71f0..25cad37e25 100644
--- a/erts/emulator/drivers/unix/ttsl_drv.c
+++ b/erts/emulator/drivers/unix/ttsl_drv.c
@@ -733,13 +733,13 @@ static void ttysl_from_erlang(ErlDrvData ttysl_data, char* buf, ErlDrvSizeT coun
else
written = 0;
if (written < 0) {
- if (errno == EAGAIN) {
+ if (errno == ERRNO_BLOCK || errno == EINTR) {
driver_select(ttysl_port,(ErlDrvEvent)(long)ttysl_fd,
ERL_DRV_USE|ERL_DRV_WRITE,1);
break;
} else {
- /* we ignore all other errors */
- break;
+ driver_failure_posix(ttysl_port, errno);
+ return;
}
} else {
if (driver_deq(ttysl_port, written) == 0)
@@ -779,11 +779,12 @@ static void ttysl_to_tty(ErlDrvData ttysl_data, ErlDrvEvent fd) {
else
written = 0;
if (written < 0) {
- if (errno == EAGAIN) {
- break;
- } else {
- /* we ignore all other errors */
+ if (errno == EINTR) {
+ continue;
+ } else if (errno != ERRNO_BLOCK){
+ driver_failure_posix(ttysl_port, errno);
}
+ break;
} else {
sz = driver_deq(ttysl_port, written);
if (sz < TTY_BUFFSIZE && ttysl_send_ok) {