Skip to content

Commit 72823d1

Browse files
committed
wip: do not expose helper functions
Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
1 parent 42e855d commit 72823d1

4 files changed

Lines changed: 10 additions & 11 deletions

File tree

init/fs.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#include "fs.h"
22

3+
static int try_mount(const char *source, const char *target, const char *fstype,
4+
unsigned long mountflags, const void *data);
5+
36
void setup_root_block_device(void)
47
{
58
int fd;
@@ -116,7 +119,7 @@ int mount_filesystems()
116119
return 0;
117120
}
118121

119-
int try_mount(const char *source, const char *target, const char *fstype,
122+
static int try_mount(const char *source, const char *target, const char *fstype,
120123
unsigned long mountflags, const void *data)
121124
{
122125
FILE *f;

init/fs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,5 @@
1717
void setup_root_block_device(void);
1818
int is_virtiofs(const char *path);
1919
int mount_filesystems();
20-
int try_mount(const char *source, const char *target, const char *fstype,
21-
unsigned long mountflags, const void *data);
2220

2321
#endif

init/utils.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ char DEFAULT_KRUN_INIT[] = "/bin/sh";
66
static int reopen_fd(int fd, char *path, int flags);
77
static void exec_child(char **exec_argv, int *saved_errno);
88
static void parent_proc_wait(int child, int *status);
9+
static void set_exit_code(int code);
10+
static int setup_redirects(void);
11+
static void set_rlimits(const char *rlimits);
912

10-
void set_exit_code(int code)
13+
static void set_exit_code(int code)
1114
{
1215
int fd;
1316
int ret;
@@ -38,7 +41,7 @@ void set_exit_code(int code)
3841
close(fd);
3942
}
4043

41-
int setup_redirects()
44+
static int setup_redirects()
4245
{
4346
DIR *ports_dir = opendir("/sys/class/virtio-ports");
4447
if (ports_dir == NULL) {
@@ -107,7 +110,7 @@ static int reopen_fd(int fd, char *path, int flags)
107110
return 0;
108111
}
109112

110-
void set_rlimits(const char *rlimits)
113+
static void set_rlimits(const char *rlimits)
111114
{
112115
unsigned long long int lim_id, lim_cur, lim_max;
113116
struct rlimit rlim;

init/utils.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,10 @@
1616
#include <sys/resource.h>
1717

1818
#define KRUN_EXIT_CODE_IOCTL 0x7602
19-
2019
#define MAX_PASS_SIZE 512
21-
2220
#define KRUN_MAGIC "KRUN"
2321
#define KRUN_FOOTER_LEN 12
2422

25-
void set_exit_code(int code);
26-
int setup_redirects(void);
27-
void set_rlimits(const char *rlimits);
2823
void setup_socket(void);
2924
void exec_init(char ***config_argv, char ***exec_argv);
3025
void handle_env_variables(char *config_workdir);

0 commit comments

Comments
 (0)