update server: Move update_running from server/ to update/

update.h is a more logical home for update_running than server.h.
Move the definition and the assignments along, from server/update.c to
lib/update/main.c.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2016-06-20 20:40:06 +02:00
parent dd9e393b38
commit 55be3c7105
11 changed files with 12 additions and 16 deletions

View file

@ -40,7 +40,6 @@
extern int shutdown_pending;
extern empth_rwlock_t *update_lock;
extern empth_rwlock_t *shutdown_lock;
extern int update_running;
extern time_t update_time[UPDATE_TIME_LEN];
void market_init(void);

View file

@ -74,6 +74,7 @@ struct budget {
};
/* main.c */
extern int update_running;
extern struct budget nat_budget[MAXNOC];
/* age.c */

View file

@ -40,7 +40,6 @@
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
#include "server.h"
#include "unit.h"
#include "update.h"

View file

@ -41,7 +41,6 @@
#include "plane.h"
#include "player.h"
#include "prototypes.h"
#include "server.h"
#include "unit.h"
#include "update.h"

View file

@ -60,7 +60,7 @@
#include "player.h"
#include "proto.h"
#include "prototypes.h"
#include "server.h"
#include "update.h"
#include "xy.h"
static void pr_player(struct player *pl, int id, char *buf);

View file

@ -39,7 +39,7 @@
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
#include "server.h"
#include "update.h"
void
setrel(natid us, natid them, int rel)

View file

@ -44,7 +44,6 @@
#include "player.h"
#include "prototypes.h"
#include "sect.h"
#include "server.h"
#include "update.h"
#include "xy.h"

View file

@ -40,7 +40,6 @@
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
#include "server.h"
#include "ship.h"
#include "unit.h"
#include "update.h"

View file

@ -43,8 +43,8 @@
#include "optlist.h"
#include "player.h"
#include "prototypes.h"
#include "server.h"
#include "tel.h"
#include "update.h"
static struct telstr last_tel[MAXNOC];

View file

@ -46,6 +46,12 @@
#include "unit.h"
#include "update.h"
/*
* Update is running.
* Can be used to suppress messages, or direct them to bulletins.
*/
int update_running;
struct budget nat_budget[MAXNOC];
void
@ -57,6 +63,7 @@ update_main(void)
int i;
struct natstr *np;
update_running = 1;
logerror("production update (%d etus)", etu);
getrusage(RUSAGE_SELF, &rus1);
game_record_update(time(NULL));
@ -134,4 +141,5 @@ update_main(void)
- (rus1.ru_utime.tv_sec + rus1.ru_utime.tv_usec / 1e6),
rus2.ru_stime.tv_sec + rus2.ru_stime.tv_usec / 1e6
- (rus1.ru_stime.tv_sec + rus1.ru_stime.tv_usec / 1e6));
update_running = 0;
}

View file

@ -50,12 +50,6 @@
#include "prototypes.h"
#include "server.h"
/*
* Update is running.
* Can be used to suppress messages, or direct them to bulletins.
*/
int update_running;
static time_t update_schedule_anchor;
static int update_wanted;
@ -205,9 +199,7 @@ update_run(void)
return;
}
}
update_running = 1;
update_main();
update_running = 0;
empth_rwlock_unlock(update_lock);
}