mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 01:39:59 +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));
|
||||
if (ret < 0) {
|
||||
SYSERROR("failed to send request to '@%s'", offset);
|
||||
goto out_close;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ret != sizeof(command->request)) {
|
||||
SYSERROR("message partially sent to '@%s'", offset);
|
||||
goto out_close;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = receive_answer(sock, &command->answer);
|
||||
if (ret < 0)
|
||||
goto out_close;
|
||||
out:
|
||||
return ret;
|
||||
out_close:
|
||||
close(sock);
|
||||
goto out;
|
||||
return ret;
|
||||
}
|
||||
|
||||
pid_t get_init_pid(const char *name)
|
||||
|
Loading…
Reference in New Issue
Block a user