mirror of
git://sourceware.org/git/lvm2.git
synced 2024-10-27 18:55:19 +03:00
cleanup: clvmd zombie removal loop
Simplier code to start scan from the next node, and remove matching pipe client.
This commit is contained in:
parent
5740c00f3b
commit
9196274c1e
@ -1179,29 +1179,20 @@ static int cleanup_zombie(struct local_client *thisfd)
|
|||||||
|
|
||||||
/* Remove the pipe client */
|
/* Remove the pipe client */
|
||||||
if (thisfd->bits.localsock.pipe_client) {
|
if (thisfd->bits.localsock.pipe_client) {
|
||||||
struct local_client *newfd;
|
struct local_client *delfd;
|
||||||
struct local_client *lastfd = NULL;
|
struct local_client *lastfd;
|
||||||
struct local_client *free_fd = NULL;
|
|
||||||
|
|
||||||
(void) close(thisfd->bits.localsock.pipe_client->fd); /* Close pipe */
|
(void) close(thisfd->bits.localsock.pipe_client->fd); /* Close pipe */
|
||||||
(void) close(thisfd->bits.localsock.pipe);
|
(void) close(thisfd->bits.localsock.pipe);
|
||||||
|
|
||||||
/* Remove pipe client */
|
/* Remove pipe client */
|
||||||
for (newfd = &local_client_head; newfd != NULL;
|
for (lastfd = &local_client_head; (delfd = lastfd->next); lastfd = delfd)
|
||||||
newfd = newfd->next) {
|
if (thisfd->bits.localsock.pipe_client == delfd) {
|
||||||
if (thisfd->bits.localsock.
|
thisfd->bits.localsock.pipe_client = NULL;
|
||||||
pipe_client == newfd) {
|
lastfd->next = delfd->next;
|
||||||
thisfd->bits.localsock.
|
dm_free(delfd);
|
||||||
pipe_client = NULL;
|
|
||||||
|
|
||||||
lastfd->next = newfd->next;
|
|
||||||
free_fd = newfd;
|
|
||||||
newfd->next = lastfd;
|
|
||||||
dm_free(free_fd);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lastfd = newfd;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user