Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 206356 Details for
Bug 283318
sys-power/acpid-1.0.10_p3 daemon crash
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for acpid-1.0.10-netlink4 to survive input device removal
acpid-1.0.10-netlink4.patch (text/plain), 1.95 KB, created by
Mikhail Krivtsov
on 2009-10-07 19:13:36 UTC
(
hide
)
Description:
patch for acpid-1.0.10-netlink4 to survive input device removal
Filename:
MIME Type:
Creator:
Mikhail Krivtsov
Created:
2009-10-07 19:13:36 UTC
Size:
1.95 KB
patch
obsolete
>diff -ur old/acpid-1.0.10-netlink4/connection_list.c new/acpid-1.0.10-netlink4/connection_list.c >--- old/acpid-1.0.10-netlink4/connection_list.c 2009-07-20 06:35:40.000000000 +0400 >+++ new/acpid-1.0.10-netlink4/connection_list.c 2009-10-07 22:46:22.000000000 +0400 >@@ -73,6 +73,26 @@ > } > > /*---------------------------------------------------------------*/ >+void delete_connection(int fd) >+{ >+ int i; >+ >+ close(fd); >+ >+ /* remove from the fd set */ >+ FD_CLR(fd, &allfds); >+ >+ for (i = 0; i < nconnections; ++i) { >+ /* if the file descriptors match, delete the connection */ >+ if (connection_list[i].fd == fd) { >+ --nconnections; >+ connection_list[i] = connection_list[nconnections]; >+ break; >+ } >+ } >+} >+ >+/*---------------------------------------------------------------*/ > > struct connection * > find_connection(int fd) >diff -ur old/acpid-1.0.10-netlink4/connection_list.h new/acpid-1.0.10-netlink4/connection_list.h >--- old/acpid-1.0.10-netlink4/connection_list.h 2009-04-29 18:37:13.000000000 +0400 >+++ new/acpid-1.0.10-netlink4/connection_list.h 2009-10-07 21:59:35.000000000 +0400 >@@ -41,6 +41,9 @@ > /* add a connection to the list */ > extern void add_connection(struct connection *p); > >+/* delete a connection from the list */ >+extern void delete_connection(int fd); >+ > /* find a connection in the list by file descriptor */ > extern struct connection *find_connection(int fd); > >diff -ur old/acpid-1.0.10-netlink4/input_layer.c new/acpid-1.0.10-netlink4/input_layer.c >--- old/acpid-1.0.10-netlink4/input_layer.c 2009-07-20 02:31:49.000000000 +0400 >+++ new/acpid-1.0.10-netlink4/input_layer.c 2009-10-07 21:58:00.000000000 +0400 >@@ -133,7 +133,11 @@ > /* if it's a signal, bail */ > if (errno == EINTR) > return; >- >+ if (errno == ENODEV) { >+ acpid_log(LOG_WARNING, "input device has been disconnected\n"); >+ delete_connection(fd); >+ return; >+ } > acpid_log(LOG_ERR, "input layer read error: %s (%d)\n", > strerror(errno), errno); > if (++nerrs >= ACPID_MAX_ERRS) {
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 283318
: 206356