recvclient() calls ef_make_stale() only when it does actual I/O, via
io_output() and io_input(). Missed in commit
2fa5f652, v4.3.24. Call
it directly when it doesn't do actual I/O.
This makes navi-march-test expose a bug in march: when the player
declines to abandon a sector, we write back stale land units,
triggering a generation oops.
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
*
* Known contributors to this file:
* Dave Pare, 1986
- * Markus Armbruster, 2006-2012
+ * Markus Armbruster, 2006-2015
* Ron Koenderink, 2009
*/
#include <config.h>
#include "empio.h"
+#include "file.h"
#include "journal.h"
#include "player.h"
#include "prototypes.h"
count = io_gets(player->iop, cmd, size);
if (count >= 0) {
/* got it */
+ if (player_io_deadline(player, 0))
+ ef_make_stale();
if (strcmp(cmd, "ctld") == 0)
player->aborted = player->got_ctld = 1;
if (strcmp(cmd, "aborted") == 0)
Connect from 127.0.0.1
tester@127.0.0.1 using country #1
tester@127.0.0.1 logged in as country #1
+Oops: elt->generation != (ef_generation & 0xfff) in ../src/lib/common/file.c:699
+Crash dump complete
+Oops: elt->generation != (ef_generation & 0xfff) in ../src/lib/common/file.c:699
+Crash dump complete
tester@127.0.0.1 logged out, country #1
Connect from 127.0.0.1
tester@127.0.0.1 using country #0