(market_init): New.
(start_server): Call it. Move initialization stuff to it, with error checking added. (market_update): Internal linkage.
This commit is contained in:
parent
02584d8a50
commit
f41e44fb74
3 changed files with 14 additions and 7 deletions
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include "empthread.h"
|
||||
#include "file.h"
|
||||
#include "optlist.h"
|
||||
#include "player.h"
|
||||
#include "prototypes.h"
|
||||
#include "server.h"
|
||||
|
@ -64,7 +65,7 @@ check_all_markets(void *unused)
|
|||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
static void
|
||||
market_update(void *unused)
|
||||
{
|
||||
time_t now;
|
||||
|
@ -85,3 +86,13 @@ market_update(void *unused)
|
|||
}
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
void
|
||||
market_init(void)
|
||||
{
|
||||
if (!opt_MARKET)
|
||||
return;
|
||||
if (!empth_create(PP_TIMESTAMP, market_update, 50 * 1024, 0,
|
||||
"MarketUpdate", "Updates the market", NULL))
|
||||
exit_nomem();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue