summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-02-16 19:30:21 -0200
committershennetsind <ind@henn.et>2013-02-16 19:30:21 -0200
commitd8280002947c462b0bb731c12c20efc301ccb891 (patch)
tree28e1b539c6df1886f8c3d234dc31361fb1a34ef7 /src/char/char.c
parentd7ce0c1ce8c4d9118d1340e48424ad9deae0da09 (diff)
downloadhercules-d8280002947c462b0bb731c12c20efc301ccb891.tar.gz
hercules-d8280002947c462b0bb731c12c20efc301ccb891.tar.bz2
hercules-d8280002947c462b0bb731c12c20efc301ccb891.tar.xz
hercules-d8280002947c462b0bb731c12c20efc301ccb891.zip
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 <ind@henn.et>
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c12
1 files changed, 9 insertions, 3 deletions
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;