ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/saidar/saidar.c
(Generate patch)

Comparing projects/libstatgrab/src/saidar/saidar.c (file contents):
Revision 1.39 by tdb, Fri Dec 1 14:21:17 2006 UTC vs.
Revision 1.42 by tdb, Sun Oct 3 18:35:58 2010 UTC

# Line 29 | Line 29
29   #include <sys/ioctl.h>
30   #include <unistd.h>
31   #include <stdlib.h>
32 #include <sys/termios.h>
32   #include <signal.h>
33   #include <errno.h>
34   #include <statgrab.h>
# Line 37 | Line 36
36   #include <limits.h>
37   #include <time.h>
38   #include <math.h>
39 + #ifdef AIX
40 + #include <termios.h>
41 + #else
42 + #include <sys/termios.h>
43 + #endif
44  
45   #ifdef HAVE_NCURSES_H
46   #define COLOR_SUPPORT
# Line 59 | Line 63
63   #define THRESHOLD_WARN_DISK 75.0
64   #define THRESHOLD_ALERT_DISK 90.0
65  
66 + int sig_winch_flag = 0;
67 +
68   typedef struct{
69          sg_cpu_percents *cpu_percents;
70          sg_mem_stats *mem_stats;
# Line 532 | Line 538 | void display_data(int colors){
538   }
539  
540   void sig_winch_handler(int dummy){
541 <        clear();
536 <        display_headings();
537 <        display_data(0);
541 >        sig_winch_flag = 1;
542          signal(SIGWINCH, sig_winch_handler);
543   }
544  
# Line 645 | Line 649 | int main(int argc, char **argv){
649          }
650   #endif
651          nonl();
652 +        curs_set(0);
653          cbreak();
654          noecho();
655          timeout(delay * 1000);
# Line 675 | Line 680 | int main(int argc, char **argv){
680                          get_stats();
681                  }
682                  last_update = now;
683 +
684 +                if(sig_winch_flag) {
685 +                        clear();
686 +                        display_headings();
687 +                        sig_winch_flag = 0;
688 +                }
689  
690                  display_data(colouron);
691          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines