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

Commit e968a4f

Browse files
authored
Merge pull request #268 from bergwolf/cleanup
Cleanup
2 parents d950a78 + a1f47f9 commit e968a4f

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/container.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static int container_setup_volume(struct hyper_container *container)
180180

181181
if (vol->readonly &&
182182
mount(volume, mountpoint, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL) < 0) {
183-
perror("mount fsmap failed");
183+
perror("mount volume ro failed");
184184
return -1;
185185
}
186186

@@ -203,7 +203,7 @@ static int container_setup_volume(struct hyper_container *container)
203203
if (st.st_mode & S_IFDIR) {
204204
if (hyper_mkdir(mountpoint, 0755) < 0) {
205205
perror("create map dir failed");
206-
continue;
206+
return -1;
207207
}
208208
if (map->docker) {
209209
/* converted from volume */
@@ -212,28 +212,30 @@ static int container_setup_volume(struct hyper_container *container)
212212
if (container->initialize &&
213213
(container_populate_volume(mountpoint, volume) < 0)) {
214214
fprintf(stderr, "fail to populate volume %s\n", mountpoint);
215-
continue;
215+
return -1;
216216
}
217217
}
218218
} else {
219219
int fd = open(mountpoint, O_CREAT|O_WRONLY, 0755);
220220
if (fd < 0) {
221221
perror("create map file failed");
222-
continue;
222+
return -1;
223223
}
224224
close(fd);
225225
}
226226

227227
if (mount(src, mountpoint, NULL, MS_BIND, NULL) < 0) {
228228
perror("mount fsmap failed");
229-
continue;
229+
return -1;
230230
}
231231

232232
if (map->readonly == 0)
233233
continue;
234234

235-
if (mount(src, mountpoint, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL) < 0)
236-
perror("mount fsmap failed");
235+
if (mount(src, mountpoint, NULL, MS_BIND | MS_REMOUNT | MS_RDONLY, NULL) < 0) {
236+
perror("mount fsmap ro failed");
237+
return -1;
238+
}
237239
}
238240

239241
return 0;

src/container.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ struct hyper_container {
3535
struct list_head list;
3636
struct hyper_exec exec;
3737
int ns;
38-
uint32_t code;
3938

4039
// configs
4140
char *id;

src/hyper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ static inline int hyper_create(char *hyper_path)
8383
return 0;
8484
}
8585

86-
int hyper_open_serial(char *tty);
8786
int hyper_enter_sandbox(struct hyper_pod *pod, int pidpipe);
8887
void hyper_pod_destroyed(int failed);
8988
int hyper_ctl_append_msg(struct hyper_event *he, uint32_t type, uint8_t *data, uint32_t len);

src/util.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ int hyper_open_channel(char *channel, int mode);
3434
int hyper_setfd_cloexec(int fd);
3535
int hyper_setfd_block(int fd);
3636
int hyper_setfd_nonblock(int fd);
37-
int hyper_socketpair(int domain, int type, int protocol, int sv[2]);
3837
void hyper_shutdown();
3938
int hyper_insmod(char *module);
4039
bool hyper_name_to_id(const char *name, unsigned long *val);

0 commit comments

Comments
 (0)