1
0

Merge pull request #768 from freechipsproject/flush_jtag_vpi

jtag_vpi: Attempt to more aggressively flush the simulator output
This commit is contained in:
Megan Wachs 2017-05-26 15:51:43 -07:00 committed by GitHub
commit f61e30763f

View File

@ -78,14 +78,18 @@ int init_jtag_server(int port)
socklen_t socklen = sizeof(serv_addr);
if (getsockname(listenfd, (struct sockaddr *)&serv_addr, &socklen) == -1) {
perror("init_jtag_server");
fflush(stderr);
exit(1);
} else {
printf("Listening on port %d\n", ntohs(serv_addr.sin_port));
fflush(stdout);
}
printf("Waiting for client connection...");
fflush(stdout);
connfd = accept(listenfd, (struct sockaddr*)NULL, NULL);
printf("ok\n");
fflush(stdout);
flags = fcntl(listenfd, F_GETFL, 0);
fcntl(listenfd, F_SETFL, flags | O_NONBLOCK);