From d0db46538283471429d094836cc8b57c23d4e99a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Mon, 9 Mar 2009 22:31:49 +0100 Subject: [PATCH] Fix swapsector not to wipe out concurrent updates. Make swaps() bail out if any of the sectors changed while edit() slept for input. --- src/lib/commands/swap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/commands/swap.c b/src/lib/commands/swap.c index e8c9d854e..d7c75f5fb 100644 --- a/src/lib/commands/swap.c +++ b/src/lib/commands/swap.c @@ -59,6 +59,8 @@ swaps(void) print_res(§b); if (!confirm ("Are you sure these are the two sectors you wish to swap? ")) return RET_FAIL; + if (!check_sect_ok(§a) || !check_sect_ok(§b)) + return RET_FAIL; tmp = secta; /* change the location of secta to that of sectb */ secta.sct_x = sectb.sct_x; -- 2.43.0