6dc017b gfs2_edit: Fix signal handling and window resize

Authored and Committed by swhiteho 12 years ago
    gfs2_edit: Fix signal handling and window resize
    
    This started out as a patch to remove the signal() call from this
    bit of code, but when I started looking in more detail, I
    spotted several other things which were wrong, so I fixed
    those instead.
    
    Firstly ncurses has its own SIGWINCH handler these days, so
    we should not be overriding it, but instead, getting the info
    about resize at getch() time.
    
    Secondly, the function for erasing the screen was using the
    supposed number of columns to index an array which was only 256
    in length, so although unlikely to happen in real life, this
    could cause an out of bounds access.
    
    The simple solution seems to be to use ncurses own functions.
    I noted some comments about them not working correctly, but
    with the additional setting of the background attributes,
    that seemed to work ok to me, unless I'm missing something.
    
    I've played around resizing the window and the like and it
    all seems to still be working correctly.
    
    Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
    
        
file modified
+0 -1
file modified
+11 -43
file modified
+0 -1