Skip to content

Commit f705b23

Browse files
havardAasentkralphs
authored andcommitted
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 477c9cd) Signed-off-by: Ted Ralphs <[email protected]>
1 parent b7a3704 commit f705b23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Osi/src/Osi/OsiSolverInterface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1418,7 +1418,7 @@ int OsiSolverInterface::writeLpNative(const char *filename,
14181418
if (!fp) {
14191419
printf("### ERROR: in OsiSolverInterface::writeLpNative(): unable to open file %s\n",
14201420
filename);
1421-
exit(1);
1421+
return (1);
14221422
}
14231423
int nerr = writeLpNative(fp, rowNames, columnNames,
14241424
epsilon, numberAcross, decimals,

0 commit comments

Comments
 (0)