]> git.pond.sub.org Git - empserver/commitdiff
update server: Move update_running from server/ to update/
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 20 Jun 2016 18:40:06 +0000 (20:40 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 6 Aug 2017 18:08:30 +0000 (20:08 +0200)
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>
include/server.h
include/update.h
src/lib/subs/land.c
src/lib/subs/plane.c
src/lib/subs/pr.c
src/lib/subs/rej.c
src/lib/subs/sect.c
src/lib/subs/ship.c
src/lib/subs/wu.c
src/lib/update/main.c
src/server/update.c

index 1448d144195dfa3199702c45b9f9e868521fc3a9..0ebd78be0a930d6b7037ff1223f7b3518bdaf626 100644 (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);
index 7a159f4ed36786cd206655628c61ebac6e60986e..2c76540f90e0798464c768c1f8dec8e246a045d6 100644 (file)
@@ -74,6 +74,7 @@ struct budget {
 };
 
 /* main.c */
+extern int update_running;
 extern struct budget nat_budget[MAXNOC];
 
 /* age.c */
index 4d18700691fa26c8f02b9a37472e61e4f9fe7c8d..f9805583866ce42422a473c912c556ff1de28dd6 100644 (file)
@@ -40,7 +40,6 @@
 #include "optlist.h"
 #include "player.h"
 #include "prototypes.h"
-#include "server.h"
 #include "unit.h"
 #include "update.h"
 
index 1c28368ff694c341f2449e8f9eab021a4b452c43..517c9b5bf5a5e7ed90994e549ad31277a8420c89 100644 (file)
@@ -41,7 +41,6 @@
 #include "plane.h"
 #include "player.h"
 #include "prototypes.h"
-#include "server.h"
 #include "unit.h"
 #include "update.h"
 
index db8943acc438562462378ac771676a1157ca1d3f..ab7922d87a1be8cce9f017656d4563f19b018dc0 100644 (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);
index 398996d5e9215f3845f8bfc06d529bd7cb4d5be3..1ac458465b8e5cac29994718f37c4056818ac08c 100644 (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)
index a53ee52b6d1ab69f874d8774a4ede113c4acb2e2..8bc4056facb3e376b45939115f45efa4023dd567 100644 (file)
@@ -44,7 +44,6 @@
 #include "player.h"
 #include "prototypes.h"
 #include "sect.h"
-#include "server.h"
 #include "update.h"
 #include "xy.h"
 
index 3c75e84c9ec6936794e9ba8a3ea0fd060412a4d8..cfd4bced968b39c3b469c145c40f6f50b49b7086 100644 (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"
index 6e4768fb21f732e2db906f0428b5acb363a6c4fd..d40af3e79474555147fe0d18c428eb520c4070f3 100644 (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];
 
index e71da43602700ad4b4405ca4c2d0207018c6df86..459232c83ca17739af2ad56bb9fecd01ae52ef65 100644 (file)
 #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;
 }
index d6caf614d4e18efb57dc5184d5c92209af310bcb..195eaa1a3af2742a915e30e50b44942a181ea8ac 100644 (file)
 #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);
 }