]> git.sesse.net Git - stockfish/commitdiff
Disable again buffering at startup
authorMarco Costalba <mcostalba@gmail.com>
Sat, 17 Dec 2011 15:56:36 +0000 (16:56 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 17 Dec 2011 15:59:32 +0000 (16:59 +0100)
Partially revert efd21679980dfd59
Without this patch SF does not send "bestmove" to GUI.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/main.cpp

index 1a8309700555bfd61ef916fad97619d48d50386f..fcb7e40c25118bf81f35a2361fd77d4d69840d33 100644 (file)
@@ -17,6 +17,7 @@
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <cstdio>
 #include <iostream>
 #include <string>
 
@@ -35,6 +36,9 @@ extern void kpk_bitbase_init();
 
 int main(int argc, char* argv[]) {
 
+  // Disable output buffering: printf() does not work correctly otherwise
+  setvbuf(stdout, NULL, _IONBF, 0);
+
   bitboards_init();
   Position::init();
   kpk_bitbase_init();