From 35a70eb47838f1da44ef7c77d07acda8ba0ecc50 Mon Sep 17 00:00:00 2001 From: Kate Date: Mon, 18 Dec 2023 23:02:09 +0000 Subject: [PATCH] Fix debug logs showing up regardless of verbosity on macOS 12.7.1 / 13.6.3 / 14.2 --- src/glpk_solver.cpp | 2 +- src/osi_solver.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glpk_solver.cpp b/src/glpk_solver.cpp index 23e53dd..950346f 100644 --- a/src/glpk_solver.cpp +++ b/src/glpk_solver.cpp @@ -79,7 +79,7 @@ int glpk_solver::solve(int timeout) { try { if (verbosity == 0) { save_stdout = dup(1); - close(1); + fclose(stdout); /* close(1) does not close stdout on macOS since macOS 12.7.1 / 13.6.3 / 14.2 (the bug has been reported) */ } glp_init_iocp(&this->mip_params); this->mip_params.gmi_cuts = GLP_ON; diff --git a/src/osi_solver.h b/src/osi_solver.h index d689ac2..00593cf 100644 --- a/src/osi_solver.h +++ b/src/osi_solver.h @@ -242,7 +242,7 @@ int osi_solver::solve(int timeout) { try { if (verbosity == 0) { save_stdout = dup(1); - close(1); + fclose(stdout); /* close(1) does not close stdout on macOS since macOS 12.7.1 / 13.6.3 / 14.2 (the bug has been reported) */ } double * obj_v = objectives[0].denseVector(nb_vars);