mirror of
https://github.com/clearlinux/hyperstart.git
synced 2026-08-27 03:25:50 +00:00
declare functions to static
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
+10
-7
@@ -24,6 +24,9 @@
|
||||
#include "parse.h"
|
||||
#include "syscall.h"
|
||||
|
||||
static int hyper_release_exec(struct hyper_exec *, struct hyper_pod *);
|
||||
static void hyper_exec_process(struct hyper_exec *exec);
|
||||
|
||||
static int send_exec_finishing(uint64_t seq, int len, int code, int block)
|
||||
{
|
||||
struct hyper_buf *buf = &ctl.tty.wbuf;
|
||||
@@ -202,7 +205,7 @@ struct hyper_event_ops err_ops = {
|
||||
/* don't need write buff, the stderr data is one way */
|
||||
};
|
||||
|
||||
int hyper_setup_exec_user(struct hyper_exec *exec)
|
||||
static int hyper_setup_exec_user(struct hyper_exec *exec)
|
||||
{
|
||||
char *user = exec->user == NULL || strlen(exec->user) == 0 ? NULL : exec->user;
|
||||
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)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hyper_setup_exec_tty(struct hyper_exec *e)
|
||||
static int hyper_setup_exec_tty(struct hyper_exec *e)
|
||||
{
|
||||
int unlock = 0;
|
||||
int ptymaster;
|
||||
@@ -410,7 +413,7 @@ int hyper_setup_exec_tty(struct hyper_exec *e)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hyper_dup_exec_tty(struct hyper_exec *e)
|
||||
static int hyper_dup_exec_tty(struct hyper_exec *e)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
@@ -457,7 +460,7 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int hyper_watch_exec_pty(struct hyper_exec *exec, struct hyper_pod *pod)
|
||||
static int hyper_watch_exec_pty(struct hyper_exec *exec, struct hyper_pod *pod)
|
||||
{
|
||||
fprintf(stdout, "hyper_init_event container pts event %p, ops %p, fd %d\n",
|
||||
&exec->stdinev, &in_ops, exec->stdinev.fd);
|
||||
@@ -607,7 +610,7 @@ out:
|
||||
}
|
||||
|
||||
// do the exec, no return
|
||||
void hyper_exec_process(struct hyper_exec *exec)
|
||||
static void hyper_exec_process(struct hyper_exec *exec)
|
||||
{
|
||||
if (sigprocmask(SIG_SETMASK, &orig_mask, NULL) < 0) {
|
||||
perror("sigprocmask restore mask failed");
|
||||
@@ -773,8 +776,8 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int hyper_release_exec(struct hyper_exec *exec,
|
||||
struct hyper_pod *pod)
|
||||
static int hyper_release_exec(struct hyper_exec *exec,
|
||||
struct hyper_pod *pod)
|
||||
{
|
||||
if (--exec->ref != 0) {
|
||||
fprintf(stdout, "still have %d user of exec\n", exec->ref);
|
||||
|
||||
@@ -45,18 +45,10 @@ struct hyper_exec {
|
||||
struct hyper_pod;
|
||||
|
||||
int hyper_exec_cmd(char *json, int length);
|
||||
int hyper_release_exec(struct hyper_exec *, struct hyper_pod *);
|
||||
int hyper_container_execcmd(struct hyper_pod *pod);
|
||||
int hyper_setup_exec_tty(struct hyper_exec *e);
|
||||
int hyper_dup_exec_tty(struct hyper_exec *e);
|
||||
int hyper_run_process(struct hyper_exec *e);
|
||||
void hyper_exec_process(struct hyper_exec *e);
|
||||
struct hyper_exec *hyper_find_exec_by_pid(struct list_head *head, int pid);
|
||||
struct hyper_exec *hyper_find_exec_by_seq(struct hyper_pod *pod, uint64_t seq);
|
||||
int hyper_setup_exec_user(struct hyper_exec *e);
|
||||
int hyper_handle_exec_exit(struct hyper_pod *pod, int pid, uint8_t code);
|
||||
int hyper_watch_exec_pty(struct hyper_exec *exec, struct hyper_pod *pod);
|
||||
void hyper_cleanup_exec(struct hyper_pod *pod);
|
||||
|
||||
extern struct hyper_event_ops pts_ops;
|
||||
#endif
|
||||
|
||||
@@ -119,7 +119,6 @@ static inline int hyper_create(char *hyper_path)
|
||||
}
|
||||
|
||||
int hyper_open_serial(char *tty);
|
||||
int hyper_start_containers(struct hyper_pod *pod);
|
||||
void hyper_cleanup_pod(struct hyper_pod *pod);
|
||||
|
||||
extern struct hyper_pod global_pod;
|
||||
|
||||
+1
-1
@@ -275,7 +275,7 @@ fail:
|
||||
goto out;
|
||||
}
|
||||
|
||||
int hyper_start_containers(struct hyper_pod *pod)
|
||||
static int hyper_start_containers(struct hyper_pod *pod)
|
||||
{
|
||||
struct hyper_container *c;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user