Merge pull request #84 from laijs/allow-container_setup_modules-failed

Allow container_setup_modules() failed
This commit is contained in:
Gao feng
2016-04-29 00:43:50 -05:00
2 changed files with 8 additions and 7 deletions
+5 -6
View File
@@ -190,7 +190,8 @@ static int container_setup_modules(struct hyper_container *container)
return 0;
}
} else if (errno == ENOENT) {
hyper_mkdir(dst);
if (hyper_mkdir(dst) < 0)
return -1;
} else {
return -1;
}
@@ -572,10 +573,8 @@ static int hyper_container_init(void *data)
goto fail;
}
if (container_setup_modules(container) < 0) {
fprintf(stderr, "container sets up modules failed\n");
goto fail;
}
// ignore error of setup modules
container_setup_modules(container);
if (container_setup_volume(container) < 0) {
fprintf(stderr, "container sets up voulme failed\n");
@@ -653,7 +652,7 @@ static int hyper_setup_pty(struct hyper_container *c)
int hyper_start_container(struct hyper_container *container,
int utsns, int ipcns, struct hyper_pod *pod)
{
int stacksize = getpagesize() * 4;
int stacksize = getpagesize() * 42;
struct hyper_container_arg arg = {
.c = container,
.pod = pod,
+3 -1
View File
@@ -181,8 +181,10 @@ int hyper_mkdir(char *hyper_path)
}
fprintf(stdout, "create directory %s\n", path);
if (mkdir(path, 0755) < 0 && errno != EEXIST)
if (mkdir(path, 0755) < 0 && errno != EEXIST) {
perror("failed to create directory");
return -1;
}
return 0;
}