Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 1097 Details for
Bug 2935
Kernel Patch to Fix read() for ACPI in new kernels
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix kernel for acpid
acpi-read.diff (text/plain), 1.68 KB, created by
Sean P. Kane
on 2002-05-22 16:26:52 UTC
(
hide
)
Description:
Patch to fix kernel for acpid
Filename:
MIME Type:
Creator:
Sean P. Kane
Created:
2002-05-22 16:26:52 UTC
Size:
1.68 KB
patch
obsolete
>--- drivers/acpi/acpi_system.c.orig Mon Mar 18 14:29:45 2002 >+++ drivers/acpi/acpi_system.c Mon Mar 18 14:29:20 2002 >@@ -415,40 +415,44 @@ > loff_t *ppos) > { > int result = 0; >- char outbuf[ACPI_MAX_STRING]; >- int size = 0; > struct acpi_bus_event event; >+ static char str[ACPI_MAX_STRING]; >+ static int chars_remaining = 0; >+ static char *ptr; > > ACPI_FUNCTION_TRACE("acpi_system_read_event"); > >- memset(&event, 0, sizeof(struct acpi_bus_event)); >+ if (!chars_remaining) { >+ memset(&event, 0, sizeof(struct acpi_bus_event)); > >- if (count < ACPI_MAX_STRING) >- goto end; >- >- if ((file->f_flags & O_NONBLOCK) >- && (list_empty(&acpi_bus_event_list))) >- return_VALUE(-EAGAIN); >- >- result = acpi_bus_receive_event(&event); >- if (0 != result) { >- size = sprintf(outbuf, "error\n"); >- goto end; >+ if ((file->f_flags & O_NONBLOCK) >+ && (list_empty(&acpi_bus_event_list))) >+ return_VALUE(-EAGAIN); >+ >+ result = acpi_bus_receive_event(&event); >+ if (0 != result) { >+ return_VALUE(-EIO); >+ } >+ >+ chars_remaining = sprintf(str, "%s %s %08x %08x\n", >+ event.device_class?event.device_class:"<unknown>", >+ event.bus_id?event.bus_id:"<unknown>", >+ event.type, event.data); >+ ptr = str; > } > >- size = sprintf(outbuf, "%s %s %08x %08x\n", >- event.device_class?event.device_class:"<unknown>", >- event.bus_id?event.bus_id:"<unknown>", >- event.type, >- event.data); >+ if (chars_remaining < count) { >+ count = chars_remaining; >+ } > >-end: >- if (copy_to_user(buffer, outbuf, size)) >+ if (copy_to_user(buffer, ptr, count)) > return_VALUE(-EFAULT); > >- *ppos += size; >+ *ppos += count; >+ chars_remaining -= count; >+ ptr += count; > >- return_VALUE(size); >+ return_VALUE(count); > } > > static int
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2935
: 1097