From 59e302dba92e596b4a934ed8ced877292f248632 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. --- src/Osi/OsiSolverInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Osi/OsiSolverInterface.cpp b/src/Osi/OsiSolverInterface.cpp index 1c97885a..40e4ad70 100644 --- a/src/Osi/OsiSolverInterface.cpp +++ b/src/Osi/OsiSolverInterface.cpp @@ -1450,7 +1450,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,