diff options
author | Alessandro Da Rugna <alessandro.darugna@gmail.com> | 2017-10-29 21:02:33 +0100 |
---|---|---|
committer | psychocrypt <psychocrypt@users.noreply.github.com> | 2017-10-29 21:05:57 +0100 |
commit | cb3fc22ac1a95eda0843aa641720b52063c3b74c (patch) | |
tree | 66b40a4d012166c1476e2840c35ec0e404f366c6 /xmrstak/jconf.cpp | |
parent | a7fb89bec2b88cc694bf88aed729451bb9bdd8a0 (diff) | |
download | xmr-stak-cb3fc22ac1a95eda0843aa641720b52063c3b74c.zip xmr-stak-cb3fc22ac1a95eda0843aa641720b52063c3b74c.tar.gz |
add option: flush stdout
Added the option to forcefully flush STDOUT, which may be useful when running the miner through a pipe instead than a shell.
If STDOUT is a shell, it's unbuffered by default.
If STDOUT is a pipe, it's buffered by default.
Diffstat (limited to 'xmrstak/jconf.cpp')
-rw-r--r-- | xmrstak/jconf.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/xmrstak/jconf.cpp b/xmrstak/jconf.cpp index 4b23ed5..c82865d 100644 --- a/xmrstak/jconf.cpp +++ b/xmrstak/jconf.cpp @@ -48,7 +48,7 @@ using namespace rapidjson; */ enum configEnum { bTlsMode, bTlsSecureAlgo, sTlsFingerprint, sPoolAddr, sWalletAddr, sPoolPwd,sCurrency, - iCallTimeout, iNetRetry, iGiveUpLimit, iVerboseLevel, iAutohashTime, + iCallTimeout, iNetRetry, iGiveUpLimit, iVerboseLevel, iAutohashTime,bFlushStdout, bDaemonMode, sOutputFile, iHttpdPort, bPreferIpv4, bNiceHashMode, bAesOverride, sUseSlowMem }; struct configVal { @@ -72,6 +72,7 @@ configVal oConfigValues[] = { { iGiveUpLimit, "giveup_limit", kNumberType }, { iVerboseLevel, "verbose_level", kNumberType }, { iAutohashTime, "h_print_time", kNumberType }, + { bFlushStdout, "flush_stdout", kTrueType}, { bDaemonMode, "daemon_mode", kTrueType }, { sOutputFile, "output_file", kStringType }, { iHttpdPort, "httpd_port", kNumberType }, @@ -448,5 +449,15 @@ bool jconf::parse_config(const char* sFilename) } #endif // _WIN32 + if (prv->configValues[bFlushStdout]->IsBool()) + { + bool bflush = prv->configValues[bFlushStdout]->GetBool(); + printer::inst()->set_flush_stdout(bflush); + if (bflush) + { + printer::inst()->print_msg(L0, "Flush stdout forced."); + } + } + return true; } |