- int retCode = 0;
- char rdBuffer[256];
-
- if (minor(dev) != RANDOM_MINOR)
- return EPERM;
-
- /* Security server is sending us entropy */
-
- while (uio_resid(uio) > 0 && retCode == 0) {
- /* get the user's data */
- int bytesToInput = MIN(uio_resid(uio),
- (user_ssize_t) sizeof(rdBuffer));
- retCode = uiomove(rdBuffer, bytesToInput, uio);
- if (retCode != 0)
- break;
- retCode = write_random(rdBuffer, bytesToInput);
- if (retCode != 0)
- break;
- }
-
- return retCode;
+ int retCode = 0;
+ char rdBuffer[256];
+
+ if (minor(dev) != RANDOM_MINOR) {
+ return EPERM;
+ }
+
+ /* Security server is sending us entropy */
+
+ while (uio_resid(uio) > 0 && retCode == 0) {
+ /* get the user's data */
+ int bytesToInput = MIN(uio_resid(uio),
+ (user_ssize_t) sizeof(rdBuffer));
+ retCode = uiomove(rdBuffer, bytesToInput, uio);
+ if (retCode != 0) {
+ break;
+ }
+ retCode = write_random(rdBuffer, bytesToInput);
+ if (retCode != 0) {
+ break;
+ }
+ }
+
+ return retCode;