X-Git-Url: http://sigaev.ru/git/gitweb.cgi?p=remotetop.git;a=blobdiff_plain;f=rtop.c;fp=rtop.c;h=a9f726080269d5ce9c004e4e8482588435b232b5;hp=59b166411ceabbd8cdcebc5af1c8636711589c4a;hb=09bd0186c6a568b8a1028d119e5289cb3ec88083;hpb=1c7a7aabdec64880fb511e0c059fd96a06475d30 diff --git a/rtop.c b/rtop.c index 59b1664..a9f7260 100644 --- a/rtop.c +++ b/rtop.c @@ -67,7 +67,6 @@ main( int argc, char *argv[] ) { int port=TOPD_SERVER_DEFAULT_PORT; int i; - MassiveUnit *mu; TCMsg *pmsg; TC_Connection cs; @@ -100,13 +99,16 @@ main( int argc, char *argv[] ) { pmsg = (TCMsg*)tmalloc( TCMSGHDRSZ ); pmsg->type = TOPGETTYPE; pmsg->len = TCMSGHDRSZ; - cs.buf = (char*)pmsg; - cs.len = pmsg->len; + cs.buf = pmsg; if ( TC_Talk(&cs, 0) == CS_OK ) { - pmsg = (TCMsg*) cs.buf; + MassiveUnit *mu; + + pmsg = cs.buf; mu = (MassiveUnit*)pmsg->data; + tlog(TL_DEBUG,"Got packet len:%db type:%08x n:%d", pmsg->len, pmsg->type, mu->number); + printf("\tIP\tLoad\tFree\tTotal\tDate\n"); for(i=0; inumber; i++) printf("%s\t%.2f\t%.1fM\t%.1fM\t%s",