uxc: fix incomplete commit
authorDaniel Golle <daniel@makrotopia.org>
Sun, 22 Nov 2020 03:16:31 +0000 (03:16 +0000)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 22 Nov 2020 03:17:19 +0000 (03:17 +0000)
Fixes: 04a2edd ("uxc: make force-delete kill container process")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
uxc.c

diff --git a/uxc.c b/uxc.c
index 9e73b0772c38602a408bd1e7120e6e6422943d83..5809b6de539e21092a39cecee5972d5462b3250c 100644 (file)
--- a/uxc.c
+++ b/uxc.c
@@ -639,6 +639,7 @@ static int uxc_boot(void)
 static int uxc_delete(char *name, bool force)
 {
        struct blob_attr *cur, *tb[__CONF_MAX];
+       struct runtime_state *s = NULL;
        int rem, ret = 0;
        bool found = false;
        char *fname;
@@ -663,9 +664,11 @@ static int uxc_delete(char *name, bool force)
        if (!found)
                return ENOENT;
 
+       s = avl_find_element(&runtime, name, s, avl);
+
        if (s && s->running) {
                if (force) {
-                       ret = uxc_kill(name, SIGKILL));
+                       ret = uxc_kill(name, SIGKILL);
                        if (ret)
                                goto errout;