"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-urandom.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-urandom.c  (stress-ng-0.12.09.tar.xz):stress-urandom.c  (stress-ng-0.12.10.tar.xz)
skipping to change at line 138 skipping to change at line 138
} }
} }
/* /*
* Fetch entropy pool count, not considered fatal if * Fetch entropy pool count, not considered fatal if
* this fails, just skip this part of the stressor * this fails, just skip this part of the stressor
*/ */
if (fd_rnd >= 0) { if (fd_rnd >= 0) {
off_t offset; off_t offset;
#if defined(RNDGETENTCNT) #if defined(RNDGETENTCNT)
unsigned long val; unsigned long val = 0;
if (ioctl(fd_rnd, RNDGETENTCNT, &val) < 0) if (ioctl(fd_rnd, RNDGETENTCNT, &val) < 0)
goto next; goto next;
/* Try to avoid emptying entropy pool */ /* Try to avoid emptying entropy pool */
if (val < 128) if (val < 128)
goto next; goto next;
#endif #endif
ret = read(fd_rnd, buffer, 1); ret = read(fd_rnd, buffer, 1);
if (ret < 0) { if (ret < 0) {
if ((errno != EAGAIN) && (errno != EINTR)) { if ((errno != EAGAIN) && (errno != EINTR)) {
skipping to change at line 179 skipping to change at line 179
*/ */
#if defined(RNDCLEARPOOL) #if defined(RNDCLEARPOOL)
ret = ioctl(fd_rnd, RNDCLEARPOOL, NULL); ret = ioctl(fd_rnd, RNDCLEARPOOL, NULL);
check_eperm(args, ret, errno); check_eperm(args, ret, errno);
#endif #endif
#if defined(RNDZAPENTCNT) #if defined(RNDZAPENTCNT)
ret = ioctl(fd_rnd, RNDZAPENTCNT, NULL); ret = ioctl(fd_rnd, RNDZAPENTCNT, NULL);
check_eperm(args, ret, errno); check_eperm(args, ret, errno);
#endif #endif
#if defined(RNDADDTOENTCNT) #if defined(RNDADDTOENTCNT)
ret = ioctl(fd_rnd, RNDADDTOENTCNT, stress_mwc32( {
)); int count = stress_mwc8();
check_eperm(args, ret, errno);
ret = ioctl(fd_rnd, RNDADDTOENTCNT, &coun
t);
check_eperm(args, ret, errno);
count = -1;
ret = ioctl(fd_rnd, RNDADDTOENTCNT, &coun
t);
check_eperm(args, ret, errno);
}
#endif #endif
#if defined(RNDRESEEDCRNG) #if defined(RNDRESEEDCRNG)
ret = ioctl(fd_rnd, RNDRESEEDCRNG, stress_mwc32() ); ret = ioctl(fd_rnd, RNDRESEEDCRNG, stress_mwc32() );
check_eperm(args, ret, errno); check_eperm(args, ret, errno);
#endif #endif
/* /*
* Exercise invalid ioctl command * Exercise invalid ioctl command
*/ */
ret = ioctl(fd_rnd, 0xffff, NULL); ret = ioctl(fd_rnd, 0xffff, NULL);
(void)ret; (void)ret;
 End of changes. 2 change blocks. 
4 lines changed or deleted 13 lines changed or added

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