Fix setsector and setres not to wipe out concurrent updates

setsector() reads the sector, prompts for input, then writes back the
sector, triggering a generation oops.  Any updates made by other
threads while setsector() waits for input are wiped out, triggering a
seqno mismatch oops.

Same for setres().
This commit is contained in:
Markus Armbruster 2011-04-16 20:34:26 +02:00
parent f4db90c849
commit 04a332a89d
2 changed files with 2 additions and 0 deletions

View file

@ -68,6 +68,7 @@ setres(void)
amt = 100;
if (amt < 0)
amt = 0;
check_sect_ok(&sect);
switch (char0) {
case 'i':
if (sect.sct_own != 0)

View file

@ -68,6 +68,7 @@ setsector(void)
if (!p || !*p)
return RET_SYN;
amt = atoi(p);
check_sect_ok(&sect);
switch (char0) {
case 'i':
current = sect.sct_min;