Skip to content

Commit

Permalink
Use return() instead of exit()
Browse files Browse the repository at this point in the history
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 477c9cd)
Signed-off-by: Ted Ralphs <[email protected]>
  • Loading branch information
havardAasen authored and tkralphs committed Dec 20, 2023
1 parent b7a3704 commit f705b23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Osi/src/Osi/OsiSolverInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit f705b23

Please sign in to comment.