]> granicus.if.org Git - strace/commitdiff
tests: make magic values in ioctl_block test distinctive
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 21 Sep 2016 21:20:53 +0000 (00:20 +0300)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 27 Sep 2016 17:55:35 +0000 (17:55 +0000)
* tests/ioctl.block (init_magic): Add iterator value to magic value
in order to enable detection of potential 4-byte aligned shifts.

tests/ioctl_block.c

index 3dc030dee03a35765ec9df947797584a5074da78..07e7d34d235ab6130dd2eb27e828ff9a26664d3a 100644 (file)
@@ -50,7 +50,7 @@ init_magic(void *addr, const unsigned int size)
        const unsigned int *end = addr + size - sizeof(int);
 
        for (; p <= end; ++p)
-               *(unsigned int *) p = magic;
+               *(unsigned int *) p = magic + (p - (unsigned int *) addr);
 }
 
 static struct xlat block_argless[] = {