aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/common
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2014-11-04 12:21:18 +0100
committerErlang/OTP <[email protected]>2014-11-04 12:21:18 +0100
commit79cf526f1ccd98706388d1472ec7abdc4aa25bd1 (patch)
tree5e2300b2df53a8175d755ba3cc0719cca2f07e9e /erts/etc/common
parent461757503e8ecaaeb3ea9b84f5c0dfccd3408694 (diff)
parent5fb392632142f3903e2be91d5ada95fc4474d2ab (diff)
downloadotp-79cf526f1ccd98706388d1472ec7abdc4aa25bd1.tar.gz
otp-79cf526f1ccd98706388d1472ec7abdc4aa25bd1.tar.bz2
otp-79cf526f1ccd98706388d1472ec7abdc4aa25bd1.zip
Merge branch 'sverk/run_erl-winsize-fix/OTP-12275' into maint-17
* sverk/run_erl-winsize-fix/OTP-12275: erts: Mend run_erl to set windows size of terminal sent from to_erl
Diffstat (limited to 'erts/etc/common')
-rw-r--r--erts/etc/common/run_erl_common.c8
-rw-r--r--erts/etc/common/run_erl_common.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/erts/etc/common/run_erl_common.c b/erts/etc/common/run_erl_common.c
index 580b6cc3c5..20b78eb05e 100644
--- a/erts/etc/common/run_erl_common.c
+++ b/erts/etc/common/run_erl_common.c
@@ -36,6 +36,10 @@
# include <syslog.h>
#endif
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
+
#ifdef __OSE__
# include "ramlog.h"
#endif
@@ -637,7 +641,7 @@ int erts_run_erl_open_fifo(char *pipename,char *w_pipename,char *r_pipename) {
/* Extract any control sequences that are ment only for run_erl
* and should not be forwarded to the pty.
*/
-int erts_run_erl_extract_ctrl_seq(char* buf, int len)
+int erts_run_erl_extract_ctrl_seq(char* buf, int len, int mfd)
{
static const char prefix[] = "\033_";
static const char suffix[] = "\033\\";
@@ -662,7 +666,7 @@ int erts_run_erl_extract_ctrl_seq(char* buf, int len)
struct winsize ws;
ws.ws_col = col;
ws.ws_row = row;
- if (ioctl(MFD, TIOCSWINSZ, &ws) < 0) {
+ if (ioctl(mfd, TIOCSWINSZ, &ws) < 0) {
ERRNO_ERR0(LOG_ERR,"Failed to set window size");
}
#endif
diff --git a/erts/etc/common/run_erl_common.h b/erts/etc/common/run_erl_common.h
index c47a0db054..14207ee4de 100644
--- a/erts/etc/common/run_erl_common.h
+++ b/erts/etc/common/run_erl_common.h
@@ -40,7 +40,7 @@ void erts_run_erl_log_error(int priority, int line, const char *format,...);
int erts_run_erl_open_fifo(char *pipename,char *w_pipename,char *r_pipename);
int erts_run_erl_log_alive_minutes(void);
-int erts_run_erl_extract_ctrl_seq(char* buf, int len);
+int erts_run_erl_extract_ctrl_seq(char* buf, int len, int mfd);
/* File operations */
ssize_t sf_read(int fd, void *buffer, size_t len);