From: Daniel Lezcano Date: Wed, 19 May 2010 20:15:28 +0000 (+0200) Subject: close socket command X-Git-Tag: lxc-0.7.0~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1362f2eba1dcf47c51cc29cd5d4ef8ea8dfdea7f;p=thirdparty%2Flxc.git close socket command We don't close the command socket after the transaction, that leads to a fd leak. Signed-off-by: Daniel Lezcano --- 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)