From 7e09213651e3e93a84614198141317a2dda4094c Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Tue, 21 Nov 2023 03:49:35 +0000
Subject: [PATCH 158/181] !2264 bugfix for runc container exec * bugfix for
 runc container exec

---
 src/daemon/modules/runtime/isula/isula_rt_ops.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/daemon/modules/runtime/isula/isula_rt_ops.c b/src/daemon/modules/runtime/isula/isula_rt_ops.c
index e88cb8bb..f058ce84 100644
--- a/src/daemon/modules/runtime/isula/isula_rt_ops.c
+++ b/src/daemon/modules/runtime/isula/isula_rt_ops.c
@@ -1313,17 +1313,16 @@ int rt_isula_exec(const char *id, const char *runtime, const rt_exec_params_t *p
     }
 
     ret = shim_create(fg_exec(params), id, workdir, bundle, cmd, exit_code, timeout, &shim_exit_code);
-    if (ret != 0) {
-        ERROR("%s: failed create shim process for exec %s", id, exec_id);
-        goto errlog_out;
-    }
-
     if (shim_exit_code == SHIM_EXIT_TIMEOUT) {
         ret = -1;
         isulad_set_error_message("Exec container error;exec timeout");
         ERROR("isulad-shim %d exit for execing timeout", pid);
         goto errlog_out;
     }
+    if (ret != 0) {
+        ERROR("%s: failed create shim process for exec %s", id, exec_id);
+        goto errlog_out;
+    }
 
     pid = get_container_process_pid(workdir);
     if (pid < 0) {
-- 
2.42.0

