iSulad/0004-judge-isula-load-file-exists.patch
haozi007 e72b756384 iSulad: sync with upstream iSulad
Signed-off-by: haozi007 <liuhao27@huawei.com>
2021-03-23 09:50:40 +08:00

30 lines
871 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 04/53] 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