Fix swapsector not to wipe out concurrent updates.

Make swaps() bail out if any of the sectors changed while edit() slept
for input.
This commit is contained in:
Markus Armbruster 2009-03-09 22:31:49 +01:00
parent 8df262bada
commit d0db465382

View file

@ -59,6 +59,8 @@ swaps(void)
print_res(&sectb); print_res(&sectb);
if (!confirm ("Are you sure these are the two sectors you wish to swap? ")) if (!confirm ("Are you sure these are the two sectors you wish to swap? "))
return RET_FAIL; return RET_FAIL;
if (!check_sect_ok(&secta) || !check_sect_ok(&sectb))
return RET_FAIL;
tmp = secta; tmp = secta;
/* change the location of secta to that of sectb */ /* change the location of secta to that of sectb */
secta.sct_x = sectb.sct_x; secta.sct_x = sectb.sct_x;