31 |
|
#include <ukcprog.h> |
32 |
|
#include <netinet/in.h> |
33 |
|
#include <netdb.h> |
34 |
+ |
#include <sys/termios.h> |
35 |
|
|
36 |
|
#include <libxml/xmlmemory.h> |
37 |
|
#include <libxml/parser.h> |
792 |
|
WINDOW *window; |
793 |
|
fd_set infds; |
794 |
|
int maxx, maxy; |
795 |
+ |
struct winsize size; |
796 |
|
|
797 |
|
FILE *control; |
798 |
|
FILE *data; |
953 |
|
data=create_tcp_connection(servername, server_data_port); |
954 |
|
if(data==NULL){ |
955 |
|
errf("Failed to connect to host %s on port %d (%m)",servername, server_data_port); |
956 |
+ |
exit(1); |
957 |
|
} |
958 |
|
|
959 |
|
/* |
977 |
|
FD_ZERO(&infds); |
978 |
|
FD_SET(stdin_fileno, &infds); |
979 |
|
FD_SET(data_fileno, &infds); |
980 |
< |
select(biggest_fileno, &infds, NULL, NULL, NULL); |
980 |
> |
if((select(biggest_fileno, &infds, NULL, NULL, NULL))==-1){ |
981 |
> |
if (ioctl(fileno(stdout), TIOCGWINSZ, &size) == 0) { |
982 |
> |
resizeterm(size.ws_row, size.ws_col); |
983 |
> |
wrefresh(curscr); |
984 |
> |
} |
985 |
> |
getmaxyx(window, maxy, maxx); |
986 |
> |
title=1; |
987 |
> |
display(machine_data_list, &display_config, maxy, &title); |
988 |
> |
refresh(); |
989 |
> |
continue; |
990 |
> |
} |
991 |
|
|
992 |
|
if(FD_ISSET(stdin_fileno, &infds)){ |
993 |
|
|