Fix issue #1757: prevent abnormal termination if failed to bind address
(cherry-picked from commit 19d9e150e1
)
This commit is contained in:
parent
368e5cb7a7
commit
99da3421ab
1 changed files with 6 additions and 1 deletions
|
@ -2836,7 +2836,12 @@ int main(int argc, char** argv) {
|
|||
}
|
||||
}
|
||||
|
||||
wesnothd::server(port, keep_alive, config_file, min_threads, max_threads).run();
|
||||
try {
|
||||
wesnothd::server(port, keep_alive, config_file, min_threads, max_threads).run();
|
||||
} catch(std::exception& e) {
|
||||
ERR_SERVER << "terminated by C++ exception: " << e.what() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue