diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index a2e98c97b..370b053ea 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -1743,7 +1743,9 @@ cursesmain( XP_Bool isServer, LaunchParams* params ) #endif #ifdef USE_GLIBLOOP - cursesListenOnSocket( &g_globals, 0, handle_stdin ); + if ( !params->closeStdin ) { + cursesListenOnSocket( &g_globals, 0, handle_stdin ); + } setOneSecondTimer( &g_globals.cGlobals ); # ifdef DEBUG int piperesult = diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index dd3e0aba5..a001d7daf 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -1546,7 +1546,6 @@ main( int argc, char** argv ) XP_Bool isServer = XP_FALSE; char* portNum = NULL; char* hostName = "localhost"; - XP_Bool closeStdin = XP_FALSE; unsigned int seed = defaultRandomSeed(); LaunchParams mainParams; XP_U16 nPlayerDicts = 0; @@ -1871,7 +1870,7 @@ main( int argc, char** argv ) break; #endif case CMD_CLOSESTDIN: - closeStdin = XP_TRUE; + mainParams.closeStdin = XP_TRUE; break; case CMD_QUITAFTER: mainParams.quitAfter = atoi(optarg); @@ -2121,7 +2120,7 @@ main( int argc, char** argv ) srandom( seed ); /* init linux random number generator */ XP_LOGF( "seeded srandom with %d", seed ); - if ( closeStdin ) { + if ( mainParams.closeStdin ) { fclose( stdin ); if ( mainParams.quitAfter < 0 ) { fprintf( stderr, "stdin closed; you'll need some way to quit\n" ); diff --git a/xwords4/linux/main.h b/xwords4/linux/main.h index 028ea0b0a..2ae3bf294 100644 --- a/xwords4/linux/main.h +++ b/xwords4/linux/main.h @@ -89,6 +89,7 @@ typedef struct LaunchParams { XP_Bool duplicatePackets; XP_Bool skipGameOver; XP_Bool useMmap; + XP_Bool closeStdin; #ifdef XWFEATURE_SEARCHLIMIT XP_Bool allowHintRect; #endif