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

Commit 97099eb

Browse files
committed
declare functions to static
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
1 parent b28a02f commit 97099eb

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

src/exec.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
#include "parse.h"
2525
#include "syscall.h"
2626

27+
static int hyper_release_exec(struct hyper_exec *, struct hyper_pod *);
28+
static void hyper_exec_process(struct hyper_exec *exec);
29+
2730
static int send_exec_finishing(uint64_t seq, int len, int code, int block)
2831
{
2932
struct hyper_buf *buf = &ctl.tty.wbuf;
@@ -202,7 +205,7 @@ struct hyper_event_ops err_ops = {
202205
/* don't need write buff, the stderr data is one way */
203206
};
204207

205-
int hyper_setup_exec_user(struct hyper_exec *exec)
208+
static int hyper_setup_exec_user(struct hyper_exec *exec)
206209
{
207210
char *user = exec->user == NULL || strlen(exec->user) == 0 ? NULL : exec->user;
208211
char *group = exec->group == NULL || strlen(exec->group) == 0 ? NULL : exec->group;
@@ -333,7 +336,7 @@ static int hyper_setup_exec_notty(struct hyper_exec *e)
333336
return 0;
334337
}
335338

336-
int hyper_setup_exec_tty(struct hyper_exec *e)
339+
static int hyper_setup_exec_tty(struct hyper_exec *e)
337340
{
338341
int unlock = 0;
339342
int ptymaster;
@@ -410,7 +413,7 @@ int hyper_setup_exec_tty(struct hyper_exec *e)
410413
return 0;
411414
}
412415

413-
int hyper_dup_exec_tty(struct hyper_exec *e)
416+
static int hyper_dup_exec_tty(struct hyper_exec *e)
414417
{
415418
int ret = -1;
416419

@@ -457,7 +460,7 @@ int hyper_dup_exec_tty(struct hyper_exec *e)
457460
return ret;
458461
}
459462

460-
int hyper_watch_exec_pty(struct hyper_exec *exec, struct hyper_pod *pod)
463+
static int hyper_watch_exec_pty(struct hyper_exec *exec, struct hyper_pod *pod)
461464
{
462465
fprintf(stdout, "hyper_init_event container pts event %p, ops %p, fd %d\n",
463466
&exec->stdinev, &in_ops, exec->stdinev.fd);
@@ -607,7 +610,7 @@ static int hyper_do_exec_cmd(struct hyper_exec *exec, struct hyper_pod *pod, int
607610
}
608611

609612
// do the exec, no return
610-
void hyper_exec_process(struct hyper_exec *exec)
613+
static void hyper_exec_process(struct hyper_exec *exec)
611614
{
612615
if (sigprocmask(SIG_SETMASK, &orig_mask, NULL) < 0) {
613616
perror("sigprocmask restore mask failed");
@@ -773,8 +776,8 @@ static int hyper_send_pod_finished(struct hyper_pod *pod)
773776
return ret;
774777
}
775778

776-
int hyper_release_exec(struct hyper_exec *exec,
777-
struct hyper_pod *pod)
779+
static int hyper_release_exec(struct hyper_exec *exec,
780+
struct hyper_pod *pod)
778781
{
779782
if (--exec->ref != 0) {
780783
fprintf(stdout, "still have %d user of exec\n", exec->ref);

src/exec.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,10 @@ struct hyper_exec {
4545
struct hyper_pod;
4646

4747
int hyper_exec_cmd(char *json, int length);
48-
int hyper_release_exec(struct hyper_exec *, struct hyper_pod *);
49-
int hyper_container_execcmd(struct hyper_pod *pod);
50-
int hyper_setup_exec_tty(struct hyper_exec *e);
51-
int hyper_dup_exec_tty(struct hyper_exec *e);
5248
int hyper_run_process(struct hyper_exec *e);
53-
void hyper_exec_process(struct hyper_exec *e);
5449
struct hyper_exec *hyper_find_exec_by_pid(struct list_head *head, int pid);
5550
struct hyper_exec *hyper_find_exec_by_seq(struct hyper_pod *pod, uint64_t seq);
56-
int hyper_setup_exec_user(struct hyper_exec *e);
5751
int hyper_handle_exec_exit(struct hyper_pod *pod, int pid, uint8_t code);
58-
int hyper_watch_exec_pty(struct hyper_exec *exec, struct hyper_pod *pod);
5952
void hyper_cleanup_exec(struct hyper_pod *pod);
6053

61-
extern struct hyper_event_ops pts_ops;
6254
#endif

src/hyper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ static inline int hyper_create(char *hyper_path)
119119
}
120120

121121
int hyper_open_serial(char *tty);
122-
int hyper_start_containers(struct hyper_pod *pod);
123122
void hyper_cleanup_pod(struct hyper_pod *pod);
124123

125124
extern struct hyper_pod global_pod;

src/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static int hyper_pod_init(void *data)
275275
goto out;
276276
}
277277

278-
int hyper_start_containers(struct hyper_pod *pod)
278+
static int hyper_start_containers(struct hyper_pod *pod)
279279
{
280280
struct hyper_container *c;
281281

0 commit comments

Comments
 (0)