]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
close socket command
authorDaniel Lezcano <daniel.lezcano@fr.ibm.com>
Wed, 19 May 2010 20:15:28 +0000 (22:15 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Wed, 19 May 2010 20:15:28 +0000 (22:15 +0200)
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>
src/lxc/commands.c

index ab230269453d30f0666dca2a479674fa5c001be7..73d711156c6a328a45da6fa9050e177968fae890 100644 (file)
@@ -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)