Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 283318
Collapse All | Expand All

(-)old/acpid-1.0.10-netlink4/connection_list.c (+20 lines)
Lines 73-78 Link Here
73
}
73
}
74
74
75
/*---------------------------------------------------------------*/
75
/*---------------------------------------------------------------*/
76
void delete_connection(int fd)
77
{
78
	int i;
79
80
	close(fd);
81
82
	/* remove from the fd set */
83
	FD_CLR(fd, &allfds);
84
85
	for (i = 0; i < nconnections; ++i) {
86
		/* if the file descriptors match, delete the connection */
87
		if (connection_list[i].fd == fd) {
88
			--nconnections;
89
			connection_list[i] = connection_list[nconnections];
90
			break;
91
		}
92
	}
93
}
94
95
/*---------------------------------------------------------------*/
76
96
77
struct connection *
97
struct connection *
78
find_connection(int fd)
98
find_connection(int fd)
(-)old/acpid-1.0.10-netlink4/connection_list.h (+3 lines)
Lines 41-46 Link Here
41
/* add a connection to the list */
41
/* add a connection to the list */
42
extern void add_connection(struct connection *p);
42
extern void add_connection(struct connection *p);
43
43
44
/* delete a connection from the list */
45
extern void delete_connection(int fd);
46
44
/* find a connection in the list by file descriptor */
47
/* find a connection in the list by file descriptor */
45
extern struct connection *find_connection(int fd);
48
extern struct connection *find_connection(int fd);
46
49
(-)old/acpid-1.0.10-netlink4/input_layer.c (-1 / +5 lines)
Lines 133-139 Link Here
133
		/* if it's a signal, bail */
133
		/* if it's a signal, bail */
134
		if (errno == EINTR)
134
		if (errno == EINTR)
135
			return;
135
			return;
136
		
136
		if (errno == ENODEV) {
137
			acpid_log(LOG_WARNING, "input device has been disconnected\n");
138
			delete_connection(fd);
139
			return;
140
		}
137
		acpid_log(LOG_ERR, "input layer read error: %s (%d)\n",
141
		acpid_log(LOG_ERR, "input layer read error: %s (%d)\n",
138
			strerror(errno), errno);
142
			strerror(errno), errno);
139
		if (++nerrs >= ACPID_MAX_ERRS) {
143
		if (++nerrs >= ACPID_MAX_ERRS) {

Return to bug 283318