Ticket #9416: driver.patch

File driver.patch, 981 bytes (added by fishpond, 7 years ago)

Patch for add-ons/kernel/drivers/random/driver.cpp

Line 
121c21
2< //#define TRACE_DRIVER
3---
4> #define TRACE_DRIVER
5405c405
6< TRACE((DRIVER_NAME ": read(%Ld,, %d)\n", position, *_numBytes));
7---
8> TRACE((DRIVER_NAME ": read(%Ld,, %ld)\n", position, *_numBytes));
9433,435c433,443
10< TRACE((DRIVER_NAME ": write(%Ld,, %d)\n", position, *_numBytes));
11< *_numBytes = 0;
12< return EINVAL;
13---
14> size_t i;
15> OCTET* data;
16> TRACE((DRIVER_NAME ": write(%Ld,, %ld)\n", position, *_numBytes));
17> mutex_lock(&sRandomLock);
18> data = (OCTET*)buffer;
19> for (i = 0; i < *_numBytes / sizeof(OCTET); i++) {
20> chseed(sRandomEnv, data->Q[0]);
21> data++;
22> }
23> mutex_unlock(&sRandomLock);
24> return B_OK;
25442c450
26< TRACE((DRIVER_NAME ": ioctl(%d)\n", op));
27---
28> TRACE((DRIVER_NAME ": ioctl(%ld)\n", op));
29476,477c484,489
30< /* we're not writable */
31< return EINVAL;
32---
33> /* we're now writable */
34> #ifndef HAIKU_TARGET_PLATFORM_HAIKU
35> notify_select_event(sync, ref);
36> #else
37> notify_select_event(sync, event);
38> #endif
39479d490
40<