mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-16 09:01:09 +00:00
close socket command
We don't close the command socket after the transaction, that leads to a fd leak. Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
parent
da2aef7f9a
commit
1362f2eba1
@ -93,22 +93,18 @@ extern int lxc_command(const char *name, struct lxc_command *command,
|
|||||||
sizeof(command->request));
|
sizeof(command->request));
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
SYSERROR("failed to send request to '@%s'", offset);
|
SYSERROR("failed to send request to '@%s'", offset);
|
||||||
goto out_close;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret != sizeof(command->request)) {
|
if (ret != sizeof(command->request)) {
|
||||||
SYSERROR("message partially sent to '@%s'", offset);
|
SYSERROR("message partially sent to '@%s'", offset);
|
||||||
goto out_close;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = receive_answer(sock, &command->answer);
|
ret = receive_answer(sock, &command->answer);
|
||||||
if (ret < 0)
|
|
||||||
goto out_close;
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
|
||||||
out_close:
|
|
||||||
close(sock);
|
close(sock);
|
||||||
goto out;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
pid_t get_init_pid(const char *name)
|
pid_t get_init_pid(const char *name)
|
||||||
|
Loading…
Reference in New Issue
Block a user