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);