Skip to content

Commit

Permalink
fix no output on weird shells, e.g. ssh
Browse files Browse the repository at this point in the history
Signed-off-by: Niklas Eiling <[email protected]>
  • Loading branch information
n-eiling committed Jul 17, 2023
1 parent bf3a15e commit f30d9b0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cpu/cpu-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,10 @@ void cricket_main(size_t prog_num, size_t vers_num)
struct sigaction act;
char *command = NULL;
act.sa_handler = int_handler;
sigaction(SIGINT, &act, NULL);
LOG(LOG_DBG(1), "log level is %d", LOG_LEVEL);
printf("welcome to cricket!\n");
init_log(LOG_LEVEL, __FILE__);
LOG(LOG_DBG(1), "log level is %d", LOG_LEVEL);
sigaction(SIGINT, &act, NULL);

#ifdef WITH_IB
char client[256];
Expand Down Expand Up @@ -317,6 +318,9 @@ void cricket_main(size_t prog_num, size_t vers_num)

LOG(LOG_INFO, "waiting for RPC requests...");

// make sure that our output is flushed even for non line-buffered shells
fflush(stdout);

svc_run();

LOG(LOG_DEBUG, "svc_run returned. Cleaning up.");
Expand Down

0 comments on commit f30d9b0

Please sign in to comment.