Ensure control socket is closed first, and wait for it to close.

This commit is contained in:
Patrick J Cherry
2018-12-07 16:32:58 +00:00
parent 5839a36ab1
commit 842e7d362d
3 changed files with 22 additions and 6 deletions

View File

@@ -78,6 +78,14 @@ void control_destroy(struct control *control)
free(control);
}
void control_wait_for_close(struct control *control)
{
NULLCHECK(control);
while (!fd_is_closed(control->control_fd)) {
usleep(10000);
}
}
struct control_client *control_client_create(struct flexnbd *flexnbd,
int client_fd,
struct mbox *state_mbox)