Commit 94c7ad6f authored by frtabu's avatar frtabu

minor fix after rebase on develop

parent 05875d7f
...@@ -688,17 +688,18 @@ void run_telnetclt(void) { ...@@ -688,17 +688,18 @@ void run_telnetclt(void) {
inet_aton("127.0.0.1", &addr) ; inet_aton("127.0.0.1", &addr) ;
name.sin_addr.s_addr = addr.s_addr; name.sin_addr.s_addr = addr.s_addr;
name.sin_port = htons((unsigned short)(telnetparams.listenport)); name.sin_port = htons((unsigned short)(telnetparams.listenport));
while (1) {
sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock < 0)
fprintf(stderr,"[TELNETSRV] Error %s on socket call\n",strerror(errno));
sock = socket(AF_INET, SOCK_STREAM, 0); if(connect(sock, (void *) &name, sizeof(name)))
if (sock < 0) fprintf(stderr,"[TELNETSRV] Error %s on connect call\n",strerror(errno));
fprintf(stderr,"[TELNETSRV] Error %s on socket call\n",strerror(errno));
if(connect(sock, (void *) &name, sizeof(name)))
fprintf(stderr,"[TELNETSRV] Error %s on connect call\n",strerror(errno));
struct timeval ts; struct timeval ts;
ts.tv_sec = 1; // 1 second ts.tv_sec = 1; // 1 second
ts.tv_usec = 0; ts.tv_usec = 0;
while (1) { while (1) {
fd_set fds; fd_set fds;
FD_ZERO(&fds); FD_ZERO(&fds);
FD_SET(sock, &fds); FD_SET(sock, &fds);
...@@ -740,8 +741,9 @@ void run_telnetclt(void) { ...@@ -740,8 +741,9 @@ void run_telnetclt(void) {
} }
free(inbuf); free(inbuf);
} }
} }
close(sock); close(sock);
}
return; return;
} /* run_telnetclt */ } /* run_telnetclt */
......
...@@ -162,7 +162,7 @@ int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt) { ...@@ -162,7 +162,7 @@ int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt) {
notifiedFIFO_elt_t *msg =newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL); notifiedFIFO_elt_t *msg =newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL);
time_stats_msg_t *msgdata=NotifiedFifoData(msg); time_stats_msg_t *msgdata=NotifiedFifoData(msg);
msgdata->msgid = TIMESTAT_MSGID_DISPLAY; msgdata->msgid = TIMESTAT_MSGID_DISPLAY;
msgdata->displayFunc = (void (*)(void *))prnt; msgdata->displayFunc = prnt;
pushNotifiedFIFO(&measur_fifo, msg); pushNotifiedFIFO(&measur_fifo, msg);
} else if ( strcmp(subcmd,"groups") == 0){ } else if ( strcmp(subcmd,"groups") == 0){
measurcmd_display_groups(prnt,measurgroups,num_measurgroups); measurcmd_display_groups(prnt,measurgroups,num_measurgroups);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment