Test the result of ioctl (TIOCGWINSZ). - irc - IRC client based on c9x.me/irc client
 (HTM) git clone git://git.codemadness.org/irc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 110c0a8075a87cf1991233c158ad51fe69e48e2a
 (DIR) parent 7242e2cc4b68ca55086a26cb57139a9b29470bbf
 (HTM) Author: Quentin Carbonneaux <qcarbonneaux@gmail.com>
       Date:   Sun, 11 Mar 2012 23:54:14 +0100
       
       Test the result of ioctl (TIOCGWINSZ).
       
       Diffstat:
         M irc.c                               |       3 ++-
       
       1 file changed, 2 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/irc.c b/irc.c
       @@ -351,7 +351,8 @@ tresize(void)
                struct winsize ws;
        
                winchg=0;
       -        ioctl(0, TIOCGWINSZ, &ws);
       +        if (ioctl(0, TIOCGWINSZ, &ws)<0)
       +                panic("Ioctl (TIOCGWINSZ) failed.");
                resizeterm(scr.y=ws.ws_row, scr.x=ws.ws_col);
                if (scr.y<3 || scr.x<10)
                        panic("Screen too small.");