aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/unix/run_erl.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc/unix/run_erl.c')
-rw-r--r--erts/etc/unix/run_erl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/etc/unix/run_erl.c b/erts/etc/unix/run_erl.c
index 81a0036c99..725343d701 100644
--- a/erts/etc/unix/run_erl.c
+++ b/erts/etc/unix/run_erl.c
@@ -627,12 +627,14 @@ static void pass_on(pid_t childpid)
status("Pty master read; ");
#endif
if ((len = sf_read(mfd, buf, BUFSIZ)) <= 0) {
+ int saved_errno = errno;
sf_close(rfd);
if(wfd) sf_close(wfd);
sf_close(mfd);
unlink(fifo1);
unlink(fifo2);
if (len < 0) {
+ errno = saved_errno;
if(errno == EIO)
ERROR0(LOG_ERR,"Erlang closed the connection.");
else
@@ -1342,10 +1344,12 @@ static int sf_open(const char *path, int type, mode_t mode) {
return fd;
}
+
static int sf_close(int fd) {
/* "close() should not be retried after an EINTR" */
return close(fd);
}
+
/* Extract any control sequences that are ment only for run_erl
* and should not be forwarded to the pty.
*/