Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 3fbba94

Browse files
committed
ignore error of setup modules
Signed-off-by: Lai Jiangshan <[email protected]>
1 parent a9b7fed commit 3fbba94

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/container.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ static int container_setup_modules(struct hyper_container *container)
190190
return 0;
191191
}
192192
} else if (errno == ENOENT) {
193-
hyper_mkdir(dst);
193+
if (hyper_mkdir(dst) < 0)
194+
return -1;
194195
} else {
195196
return -1;
196197
}
@@ -572,10 +573,8 @@ static int hyper_container_init(void *data)
572573
goto fail;
573574
}
574575

575-
if (container_setup_modules(container) < 0) {
576-
fprintf(stderr, "container sets up modules failed\n");
577-
goto fail;
578-
}
576+
// ignore error of setup modules
577+
container_setup_modules(container);
579578

580579
if (container_setup_volume(container) < 0) {
581580
fprintf(stderr, "container sets up voulme failed\n");

src/util.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ int hyper_mkdir(char *hyper_path)
181181
}
182182

183183
fprintf(stdout, "create directory %s\n", path);
184-
if (mkdir(path, 0755) < 0 && errno != EEXIST)
184+
if (mkdir(path, 0755) < 0 && errno != EEXIST) {
185+
perror("failed to create directory");
185186
return -1;
187+
}
186188

187189
return 0;
188190
}

0 commit comments

Comments
 (0)