]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
commands_utils: fix lxc-wait 3583/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 18 Nov 2020 20:06:37 +0000 (21:06 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 18 Nov 2020 20:06:37 +0000 (21:06 +0100)
Closes: #3570
Fixes: 7792a5b60f79 ("commands: add additional check to lxc_cmd_sock_get_state()")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/commands_utils.c
src/lxc/state.c

index 2af722ca1224836598461d32111425439995a47a..cba8e9c10d46d4e15e9ea584c7ffb42cece4401c 100644 (file)
@@ -62,7 +62,7 @@ int lxc_cmd_sock_get_state(const char *name, const char *lxcpath,
 
        ret = lxc_cmd_add_state_client(name, lxcpath, states, &state_client_fd);
        if (ret < 0)
-               return ret_errno(EINVAL);
+               return -errno;
 
        if (ret < MAX_STATE)
                return ret;
index 28ab60c4b99d0ab0b750a41e9597c133a5ba1071..d131e2ebebb215e95abbb587766dbdf24f8e0098 100644 (file)
@@ -100,10 +100,8 @@ int lxc_wait(const char *lxcname, const char *states, int timeout,
                if (state >= 0)
                        break;
 
-               if (errno != ECONNREFUSED) {
-                       SYSERROR("Failed to receive state from monitor");
-                       return -1;
-               }
+               if (errno != ECONNREFUSED)
+                       return log_error_errno(-1, errno, "Failed to receive state from monitor");
 
                if (timeout > 0)
                        timeout--;