iSulad/0007-create-fix-wrong-ret-code.patch
gaohuatao 147f0afca6 update from openeuler
Signed-off-by: gaohuatao <gaohuatao@huawei.com>
2020-11-12 19:32:18 +08:00

49 lines
1.3 KiB
Diff

From ba32dabc6d6304410ed6c731c2f276c1f50a9b06 Mon Sep 17 00:00:00 2001
From: lifeng68 <lifeng68@huawei.com>
Date: Fri, 23 Oct 2020 10:05:07 +0800
Subject: [PATCH 07/28] create: fix wrong ret code
Signed-off-by: lifeng68 <lifeng68@huawei.com>
---
src/cmd/isula/base/create.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/cmd/isula/base/create.c b/src/cmd/isula/base/create.c
index 12903ce..96ca483 100644
--- a/src/cmd/isula/base/create.c
+++ b/src/cmd/isula/base/create.c
@@ -1249,24 +1249,24 @@ int client_create(struct client_arguments *args)
request->image = util_strdup_s(args->image_name);
container_spec = request_pack_custom_conf(args);
- if (container_spec == 0) {
- ret = -1;
+ if (container_spec == NULL) {
+ ret = EINVALIDARGS;
goto out;
}
if (generate_container_config(container_spec, &request->container_spec_json) != 0) {
- ret = -1;
+ ret = EINVALIDARGS;
goto out;
}
host_spec = request_pack_host_config(args);
- if (host_spec == 0) {
- ret = -1;
+ if (host_spec == NULL) {
+ ret = EINVALIDARGS;
goto out;
}
if (generate_hostconfig(host_spec, &request->host_spec_json) != 0) {
- ret = -1;
+ ret = EINVALIDARGS;
goto out;
}
--
2.20.1