[sylverant] r764 committed - Don't crash if the ship can't be started... Exit gracefully instead.

1 view
Skip to first unread message

sylv...@googlecode.com

unread,
Dec 16, 2014, 3:16:31 PM12/16/14
to sylverant-...@googlegroups.com
Revision: 764
Author: blue...@gmail.com
Date: Tue Dec 16 20:16:17 2014 UTC
Log: Don't crash if the ship can't be started... Exit gracefully
instead.

https://code.google.com/p/sylverant/source/detail?r=764

Modified:
/trunk/ship_server/src/ship_server.c

=======================================
--- /trunk/ship_server/src/ship_server.c Thu Jan 16 00:52:51 2014 UTC
+++ /trunk/ship_server/src/ship_server.c Tue Dec 16 20:16:17 2014 UTC
@@ -225,14 +225,14 @@

if(cfg->v2_pmtdata_file)
debug(DBG_LOG, "v2 ItemPMT file: %s\n", cfg->v2_pmtdata_file);
-
+
if(cfg->gc_pmtdata_file)
debug(DBG_LOG, "GC ItemPMT file: %s\n", cfg->gc_pmtdata_file);

if(cfg->bb_pmtdata_file)
debug(DBG_LOG, "BB ItemPMT file: %s\n", cfg->bb_pmtdata_file);

- debug(DBG_LOG, "Units +/- limit: v2: %s, GC: %s, BB: %s\n",
+ debug(DBG_LOG, "Units +/- limit: v2: %s, GC: %s, BB: %s\n",
(cfg->local_flags &
SYLVERANT_SHIP_PMT_LIMITV2) ? "true" : "false",
(cfg->local_flags &
SYLVERANT_SHIP_PMT_LIMITGC) ? "true" : "false",
(cfg->local_flags &
SYLVERANT_SHIP_PMT_LIMITBB) ? "true" : "false");
@@ -618,7 +618,8 @@

/* Set up the ship and start it. */
ship = ship_server_start(cfg);
- pthread_join(ship->thd, NULL);
+ if(ship)
+ pthread_join(ship->thd, NULL);

/* Clean up... */
if((tmp = pthread_getspecific(sendbuf_key))) {
Reply all
Reply to author
Forward
0 new messages