Fix generation numbers for news file

nreport() caches recent news reports in cache[], so it can collapse
multiple news reports into one.  Writing back such a collapsed news
report triggered a generation oops when the processor had been yielded
since the cached report was last written back.  But this is actually
perfectly safe, because the cache can't become stale: news file
updates either go through the cache (nreport()), or they clear the
entire cache (delete_old_news()).

Silence the oops by marking the news report fresh.

A case could be made for removing nws_generation alltogether.  Maybe
later.
This commit is contained in:
Markus Armbruster 2009-03-08 18:49:06 +01:00
parent bba8db34d0
commit 8ebed5ba05

View file

@ -61,6 +61,8 @@ nreport(natid actor, int event, natid victim, int times)
return; return;
np = ncache(actor, event, victim, times); np = ncache(actor, event, victim, times);
/* TODO get rid of nws_generation? */
ef_mark_fresh(EF_NEWS, np);
putnews(np->nws_uid, np); putnews(np->nws_uid, np);
/* /*