erroring out when it shouldn't. The errno could be changed by usleep() between
the ioctl call and the loop check, if a signal was received. This could cause
an EAGAIN return from the DRM_RADEON_TEXTURE ioctl to not loop again.
Instead of checking errno, check thevalue of ret itself, since it is a saved
(and sign-flipped) copy of errno from the ioctl call.
fprintf(stderr, "DRM_RADEON_TEXTURE: again!\n");
usleep(1);
}
- } while ( ret && errno == EAGAIN );
+ } while ( ret == -EAGAIN );
UNLOCK_HARDWARE( rmesa );
"DRM_RADEON_TEXTURE: again!\n");
usleep(1);
}
- } while (ret && errno == EAGAIN);
+ } while (ret == -EAGAIN);
UNLOCK_HARDWARE(&rmesa->radeon);
do {
ret = drmCommandWriteRead( rmesa->dri.fd, DRM_RADEON_TEXTURE,
&tex, sizeof(drm_radeon_texture_t) );
- } while ( ret && errno == EAGAIN );
+ } while ( ret == -EAGAIN );
UNLOCK_HARDWARE( rmesa );