"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-apparmor.c" between
stress-ng-0.12.09.tar.xz and stress-ng-0.12.10.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-apparmor.c  (stress-ng-0.12.09.tar.xz):stress-apparmor.c  (stress-ng-0.12.10.tar.xz)
skipping to change at line 508 skipping to change at line 508
} }
/* /*
* apparmor_corrupt_flip_bits_random_burst * apparmor_corrupt_flip_bits_random_burst
* randomly flip a burst of contiguous bits * randomly flip a burst of contiguous bits
*/ */
static inline void apparmor_corrupt_flip_bits_random_burst( static inline void apparmor_corrupt_flip_bits_random_burst(
char *copy, const size_t len) char *copy, const size_t len)
{ {
uint32_t i; uint32_t i;
size_t p = (size_t)stress_mwc32() % (len * sizeof(char)); size_t p = (size_t)stress_mwc32() % (len * sizeof(*copy));
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
if (p > len) if (p > len)
p = 0; p = 0;
copy[p] ^= (1 << (p & 7)); copy[p] ^= (1 << (p & 7));
p++; p++;
} }
} }
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)