empth_init(), because writing calls empth_self(). Move call of
journal_startup().
(ef_close_srv, finish_server, panic): Move call of journal_shutdown()
for symmetry.
#include <signal.h>
#include <unistd.h>
#include "empthread.h"
+#include "journal.h"
#include "prototypes.h"
static void panic(int sig);
logerror("server received fatal signal %d", sig);
log_last_commands();
ef_fin_srv();
+ journal_shutdown();
/* End of unsafe code */
if (CANT_HAPPEN(sig != SIGBUS && sig != SIGSEGV
#include <config.h>
#include "file.h"
-#include "journal.h"
#include "prototypes.h"
struct fileinit {
{
int failed = 0;
- failed |= journal_startup() < 0;
failed |= !ef_open(EF_NATION, EFF_MEM);
failed |= !ef_open(EF_SECTOR, EFF_MEM);
failed |= !ef_open(EF_SHIP, EFF_MEM);
ef_close(EF_BMAP);
ef_close(EF_LOST);
ef_close(EF_REALM);
- journal_shutdown();
}
static int
empth_init((void **)&player, flags);
+ if (journal_startup() < 0)
+ exit(1);
+
empth_create(PP_ACCEPT, player_accept, (50 * 1024), flags,
"AcceptPlayers", "Accept network connections", 0);
empth_create(PP_KILLIDLE, player_kill_idle, (50 * 1024), flags,
#if defined(_WIN32)
loc_NTTerm();
#endif
+ journal_shutdown();
remove(pidfname);
}