]> git.pond.sub.org Git - empserver/commitdiff
Fix give not to wipe out concurrect updates
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 11 Apr 2011 19:52:10 +0000 (21:52 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 14 Apr 2011 18:21:23 +0000 (20:21 +0200)
give() reads the sector, prompts for input, updates the sector and
writes it back, triggering a generation oops.  Any updates made by
other threads during the yield are wiped out, triggering a seqno
mismatch oops.

src/lib/commands/give.c

index 82b37ec2f99b69eaae085a49695305e3e2774776..656b0896ace261bddc4f785ac8719e3ce997b97a 100644 (file)
@@ -62,6 +62,7 @@ give(void)
            return RET_SYN;
        if ((amt = atoi(p)) == 0)
            return RET_SYN;
+       check_sect_ok(&sect);
        n = sect.sct_item[ip->i_uid];
        if (amt < 0 && -amt > n) {
            m = 0;