File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -315,15 +315,20 @@ int main(int argc, char **argv) {
315
315
sbasic_main (runBas);
316
316
puts (g_canvas.getPage ().c_str ());
317
317
} else {
318
- fprintf (stdout, " Starting SmallBASIC web server on port:%d\n " , port);
318
+ fprintf (stdout, " Starting SmallBASIC web server on port:%d. Press return to exit. \n " , port);
319
319
MHD_Daemon *d = MHD_start_daemon (MHD_USE_INTERNAL_POLLING_THREAD, port,
320
320
&accept_cb, nullptr ,
321
321
&access_cb, nullptr , MHD_OPTION_END);
322
322
if (d == nullptr ) {
323
323
fprintf (stderr, " startup failed\n " );
324
324
return 1 ;
325
325
}
326
- getc (stdin);
326
+
327
+ while (getc (stdin) != ' \n ' ) {
328
+ usleep (10000 ); // On Raspberry Pi OS getc returns immediately EOF if in background.
329
+ // Sleep to reduce cpu usage.
330
+ }
331
+
327
332
MHD_stop_daemon (d);
328
333
}
329
334
free (execBas);
You can’t perform that action at this time.
0 commit comments