From 04933720277e4681db68eeae8fc4a4ce4021cf4f Mon Sep 17 00:00:00 2001 From: Megan Wachs Date: Fri, 26 May 2017 11:48:45 -0700 Subject: [PATCH] jtag_vpi: Attempt to more aggressively flush the simulator output as it is needed by other listeners --- csrc/jtag_vpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csrc/jtag_vpi.c b/csrc/jtag_vpi.c index de2d9272..b7a2f201 100644 --- a/csrc/jtag_vpi.c +++ b/csrc/jtag_vpi.c @@ -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);