Commit 1362f2eb by Daniel Lezcano Committed by Daniel Lezcano

close socket command

We don't close the command socket after the transaction, that leads to a fd leak. Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent da2aef7f
...@@ -93,22 +93,18 @@ extern int lxc_command(const char *name, struct lxc_command *command, ...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment