From f705b23f2c6767b1cedc07edcb0c07e14c41fd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard?= Date: Wed, 20 Dec 2023 11:41:21 +0000 Subject: [PATCH] Use return() instead of exit() Previously, the function employed `exit()`, which, when invoked, results in the immediate termination of the entire program. In a library this is not a wanted response when handling errors, a better approach is to return an error code and let the calling application handle the error. (cherry picked from commit 477c9cd4f947936655feb3a5a3e38011052c1c25) Signed-off-by: Ted Ralphs --- Osi/src/Osi/OsiSolverInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Osi/src/Osi/OsiSolverInterface.cpp b/Osi/src/Osi/OsiSolverInterface.cpp index 3e44df41..396e61bd 100644 --- a/Osi/src/Osi/OsiSolverInterface.cpp +++ b/Osi/src/Osi/OsiSolverInterface.cpp @@ -1418,7 +1418,7 @@ int OsiSolverInterface::writeLpNative(const char *filename, if (!fp) { printf("### ERROR: in OsiSolverInterface::writeLpNative(): unable to open file %s\n", filename); - exit(1); + return (1); } int nerr = writeLpNative(fp, rowNames, columnNames, epsilon, numberAcross, decimals,