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

Commit 84207a3

Browse files
committed
Merge pull request #84 from laijs/allow-container_setup_modules-failed
Allow container_setup_modules() failed
2 parents a9b7fed + ab1c293 commit 84207a3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/container.c

Lines changed: 5 additions & 6 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");
@@ -653,7 +652,7 @@ static int hyper_setup_pty(struct hyper_container *c)
653652
int hyper_start_container(struct hyper_container *container,
654653
int utsns, int ipcns, struct hyper_pod *pod)
655654
{
656-
int stacksize = getpagesize() * 4;
655+
int stacksize = getpagesize() * 42;
657656
struct hyper_container_arg arg = {
658657
.c = container,
659658
.pod = pod,

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)