From 8c6f141a9985c6294004b9335555d13b58bef739 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 3 Sep 2012 22:05:15 +0000 Subject: [PATCH] neercs: fix SetWindowSize parameter handling. --- neercs/term/pty.cpp | 6 +++--- neercs/term/pty.h | 2 +- neercs/term/term.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/neercs/term/pty.cpp b/neercs/term/pty.cpp index 3d16910..657252f 100644 --- a/neercs/term/pty.cpp +++ b/neercs/term/pty.cpp @@ -78,7 +78,7 @@ void Pty::Run(char const *command) } else if (pid == 0) { - SetWindowSize(m_size); + SetWindowSize(0, m_size); /* putenv() eats the string, they need to be writable */ static char tmp1[] = "CACA_DRIVER=slang"; @@ -175,7 +175,7 @@ void Pty::UnreadData(char *data, size_t len) m_unread_data = new_data; } -void Pty::SetWindowSize(ivec2 size) +void Pty::SetWindowSize(int64_t fd, ivec2 size) { #if defined HAVE_PTY_H || defined HAVE_UTIL_H || defined HAVE_LIBUTIL_H m_size = size; @@ -185,7 +185,7 @@ void Pty::SetWindowSize(ivec2 size) memset(&ws, 0, sizeof(ws)); ws.ws_row = size.y; ws.ws_col = size.x; - ioctl((int)m_fd, TIOCSWINSZ, (char *)&ws); + ioctl((int)fd, TIOCSWINSZ, (char *)&ws); #endif } diff --git a/neercs/term/pty.h b/neercs/term/pty.h index dbf1600..edb147a 100644 --- a/neercs/term/pty.h +++ b/neercs/term/pty.h @@ -14,7 +14,7 @@ public: void Run(char const *command); size_t ReadData(char *data, size_t maxlen); void UnreadData(char *data, size_t len); - void SetWindowSize(ivec2 size); + void SetWindowSize(int64_t fd, ivec2 size); private: int64_t m_fd; diff --git a/neercs/term/term.cpp b/neercs/term/term.cpp index 6ac8c18..5a0a6b9 100644 --- a/neercs/term/term.cpp +++ b/neercs/term/term.cpp @@ -25,8 +25,8 @@ Term::Term(ivec2 size) if (!shell) shell = "/bin/sh"; shell = "cacaclock"; - shell = "cacademo"; shell = "cacafire"; + shell = "cacademo"; m_pty->Run(shell); #endif }