Skip to content

Commit

Permalink
TEST: trying to force TIOCGWINSZ usage (trying to figure out, if cons…
Browse files Browse the repository at this point in the history
…ole size is possible to receive under Travis)
  • Loading branch information
Oldes committed Dec 18, 2018
1 parent 3c94c8b commit be97e5d
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/os/posix/dev-stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,7 @@ static void Close_Stdio(void)
**
***********************************************************************/
{
#ifdef WIOCGETD
puts("========================= DEFINED WIOCGETD");
#endif
#ifdef TIOCGWINSZ
//#ifdef TIOCGWINSZ
puts("========================= USING TIOCGWINSZ");
struct winsize w;
if (ioctl(Std_Out, TIOCGWINSZ, &w) != 0) {
Expand All @@ -286,19 +283,19 @@ static void Close_Stdio(void)
req->console.buffer_rows = w.ws_row;
req->console.window_cols =
req->console.buffer_cols = w.ws_col;
#else
#ifdef WIOCGETD
struct uwdata w;
if (ioctl(Std_Out, WIOCGETD, &w) != 0) {
req->error = errno;
return DR_ERROR;
}
req->console.window_rows =
req->console.buffer_rows = w.uw_height / w.uw_vs;
req->console.window_cols =
req->console.buffer_cols = w.uw_width / w.uw_hs;
#endif
#endif
//#else
//#ifdef WIOCGETD
// struct uwdata w;
// if (ioctl(Std_Out, WIOCGETD, &w) != 0) {
// req->error = errno;
// return DR_ERROR;
// }
// req->console.window_rows =
// req->console.buffer_rows = w.uw_height / w.uw_vs;
// req->console.window_cols =
// req->console.buffer_cols = w.uw_width / w.uw_hs;
//#endif
//#endif
return DR_DONE;
}

Expand Down

0 comments on commit be97e5d

Please sign in to comment.