From 1362f2eba1dcf47c51cc29cd5d4ef8ea8dfdea7f Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Wed, 19 May 2010 22:15:28 +0200 Subject: [PATCH] close socket command We don't close the command socket after the transaction, that leads to a fd leak. Signed-off-by: Daniel Lezcano --- src/lxc/commands.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/lxc/commands.c b/src/lxc/commands.c index ab2302694..73d711156 100644 --- a/src/lxc/commands.c +++ b/src/lxc/commands.c @@ -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)