The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3583
This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.
=== Description (from pull-request) ===
Closes: #3570
Fixes: 7792a5b60f79 ("commands: add additional check to lxc_cmd_sock_get_state()")
Signed-off-by: Christian Brauner <[email protected]>
From d2bab66fa9f5ce742bd1729f4710b2a06726bdd6 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Wed, 18 Nov 2020 21:06:37 +0100
Subject: [PATCH] commands_utils: fix lxc-wait
Closes: #3570
Fixes: 7792a5b60f79 ("commands: add additional check to
lxc_cmd_sock_get_state()")
Signed-off-by: Christian Brauner <[email protected]>
---
src/lxc/commands_utils.c | 2 +-
src/lxc/state.c | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/lxc/commands_utils.c b/src/lxc/commands_utils.c
index 2af722ca12..cba8e9c10d 100644
--- a/src/lxc/commands_utils.c
+++ b/src/lxc/commands_utils.c
@@ -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;
diff --git a/src/lxc/state.c b/src/lxc/state.c
index 28ab60c4b9..d131e2ebeb 100644
--- a/src/lxc/state.c
+++ b/src/lxc/state.c
@@ -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--;
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel