From d8280002947c462b0bb731c12c20efc301ccb891 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 16 Feb 2013 19:30:21 -0200 Subject: Minor changes; check description Login and Char servers will now exit when failing to bind to the port (as map server has always done). Moved Sql_HerculesUpdateCheck() to be run before "server is 'ready' " thing for layout-purposes. Signed-off-by: shennetsind --- src/char/char.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/char/char.c') diff --git a/src/char/char.c b/src/char/char.c index 8b75f6394..b6c88623c 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -4830,10 +4830,16 @@ int do_init(int argc, char **argv) Sql_ShowDebug(sql_handle); set_defaultparse(parse_char); - char_fd = make_listen_bind(bind_ip, char_port); - ShowStatus("The char-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", char_port); - + + if( (char_fd = make_listen_bind(bind_ip,char_port)) == -1 ) { + ShowFatalError("Failed to bind to port '"CL_WHITE"%d"CL_RESET"'\n",char_port); + exit(EXIT_FAILURE); + } + Sql_HerculesUpdateCheck(sql_handle); + + ShowStatus("The char-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", char_port); + if( runflag != CORE_ST_STOP ) { shutdown_callback = do_shutdown; -- cgit v1.2.3-70-g09d2