iSulad/0004-judge-isula-load-file-exists.patch
Li Feng 2c873f3fa9 iSulad: sync with upstream
Signed-off-by: Li Feng <lifeng2221dd1@zoho.com.cn>
(cherry picked from commit 230d9a529755704c38f8051b8fe35f4543e5b806)
2021-01-18 20:19:07 +08:00

30 lines
869 B
Diff

From c0b6c4187a3c66bef8b75a63e699df1be57d05b4 Mon Sep 17 00:00:00 2001
From: gaohuatao <gaohuatao@huawei.com>
Date: Mon, 11 Jan 2021 18:29:26 +0800
Subject: [PATCH 4/9] judge isula load file exists
Signed-off-by: gaohuatao <gaohuatao@huawei.com>
---
src/cmd/isula/images/load.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/cmd/isula/images/load.c b/src/cmd/isula/images/load.c
index 343d8d6d..0fb8014e 100644
--- a/src/cmd/isula/images/load.c
+++ b/src/cmd/isula/images/load.c
@@ -162,6 +162,11 @@ int cmd_load_main(int argc, const char **argv)
g_cmd_load_args.file = file;
}
+ if (!util_file_exists(g_cmd_load_args.file)) {
+ COMMAND_ERROR("File %s is not exist", g_cmd_load_args.file);
+ exit(exit_code);
+ }
+
ret = client_load_image(&g_cmd_load_args);
if (ret) {
exit(exit_code);
--
2.25.1