--- projects/libstatgrab/src/saidar/saidar.c 2006/12/01 14:21:17 1.39 +++ projects/libstatgrab/src/saidar/saidar.c 2010/10/03 18:35:58 1.42 @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * $Id: saidar.c,v 1.39 2006/12/01 14:21:17 tdb Exp $ + * $Id: saidar.c,v 1.42 2010/10/03 18:35:58 tdb Exp $ */ #ifdef HAVE_CONFIG_H @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -37,6 +36,11 @@ #include #include #include +#ifdef AIX +#include +#else +#include +#endif #ifdef HAVE_NCURSES_H #define COLOR_SUPPORT @@ -59,6 +63,8 @@ #define THRESHOLD_WARN_DISK 75.0 #define THRESHOLD_ALERT_DISK 90.0 +int sig_winch_flag = 0; + typedef struct{ sg_cpu_percents *cpu_percents; sg_mem_stats *mem_stats; @@ -532,9 +538,7 @@ void display_data(int colors){ } void sig_winch_handler(int dummy){ - clear(); - display_headings(); - display_data(0); + sig_winch_flag = 1; signal(SIGWINCH, sig_winch_handler); } @@ -645,6 +649,7 @@ int main(int argc, char **argv){ } #endif nonl(); + curs_set(0); cbreak(); noecho(); timeout(delay * 1000); @@ -675,6 +680,12 @@ int main(int argc, char **argv){ get_stats(); } last_update = now; + + if(sig_winch_flag) { + clear(); + display_headings(); + sig_winch_flag = 0; + } display_data(colouron); }