mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-14 06:28:16 +00:00
defect 1201
cleanup poll_dispatch_delete in trunk git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@991 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
990d0af0ce
commit
ca04a99884
@ -245,7 +245,6 @@ int poll_dispatch_delete (
|
||||
{
|
||||
struct poll_instance *poll_instance;
|
||||
int i;
|
||||
int found = 0;
|
||||
int res = 0;
|
||||
|
||||
res = hdb_handle_get (&poll_instance_database, handle,
|
||||
@ -258,32 +257,15 @@ int poll_dispatch_delete (
|
||||
/*
|
||||
* Find dispatch fd to delete
|
||||
*/
|
||||
res = -EBADF;
|
||||
for (i = 0; i < poll_instance->poll_entry_count; i++) {
|
||||
if (poll_instance->poll_entries[i].ufd.fd == fd) {
|
||||
found = 1;
|
||||
poll_instance->poll_entries[i].ufd.fd = -1;
|
||||
poll_instance->poll_entries[i].ufd.revents = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
poll_instance->poll_entries[i].ufd.fd = -1;
|
||||
poll_instance->poll_entries[i].ufd.revents = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < poll_instance->poll_entry_count; i++) {
|
||||
if (poll_instance->ufds[i].fd == fd) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
res = -EBADF;
|
||||
if (found) {
|
||||
poll_instance->ufds[i].fd = -1;
|
||||
poll_instance->ufds[i].revents = 0;
|
||||
res = 0;
|
||||
}
|
||||
|
||||
|
||||
hdb_handle_put (&poll_instance_database, handle);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user