File tree Expand file tree Collapse file tree 7 files changed +15
-13
lines changed Expand file tree Collapse file tree 7 files changed +15
-13
lines changed Original file line number Diff line number Diff line change 1
- CFLAGS ?= -std=c99 -Wall -O2 -fomit-frame-pointer
1
+ CFLAGS = -std=c99 -O2 -fomit-frame-pointer
2
+ CFLAGS += -Wall -Wextra -Wundef -Wold-style-definition
2
3
LDFLAGS = -s -static
3
4
4
5
BINARIES = mininit-initramfs mininit-syspart splashkill
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ static int multi_mount(
53
53
return -1 ;
54
54
}
55
55
56
- const char * mount_boot ()
56
+ const char * mount_boot (void )
57
57
{
58
58
/* Create boot and root mount points.
59
59
* Failure is most likely fatal, but perhaps mkdir on a usable mount point
@@ -77,7 +77,7 @@ const char *mount_boot()
77
77
return boot_mount ;
78
78
}
79
79
80
- int open_dir_to_clean ()
80
+ int open_dir_to_clean (void )
81
81
{
82
82
int fd = open ("/" , O_PATH | O_DIRECTORY );
83
83
if (fd < 0 ) {
@@ -86,7 +86,7 @@ int open_dir_to_clean()
86
86
return fd ;
87
87
}
88
88
89
- int switch_root ()
89
+ int switch_root (void )
90
90
{
91
91
DEBUG ("Switching root\n" );
92
92
Original file line number Diff line number Diff line change 9
9
#include "loop.h"
10
10
11
11
12
- int logetfree ()
12
+ int logetfree (void )
13
13
{
14
14
int fd = open ("/dev/loop-control" , O_RDWR );
15
15
if (fd < 0 ) {
Original file line number Diff line number Diff line change 5
5
* Find or allocate a free loop device.
6
6
* Returns the minor block device number (0-255), or -1 on errors.
7
7
*/
8
- int logetfree ();
8
+ int logetfree (void );
9
9
10
10
/**
11
11
* Set the given file as a backing file for the given loop device.
Original file line number Diff line number Diff line change @@ -14,18 +14,18 @@ int create_mount_point(const char *path);
14
14
* is mounted.
15
15
* Returns the mount point of the boot partition on success and NULL on errors.
16
16
*/
17
- const char * mount_boot ();
17
+ const char * mount_boot (void );
18
18
19
19
/**
20
20
* Returns a file descriptor for the directory to be cleaned up before we exec.
21
21
* If there is nothing to clean up, return -1.
22
22
* If there was an error opening the directory, return -1 as well.
23
23
*/
24
- int open_dir_to_clean ();
24
+ int open_dir_to_clean (void );
25
25
26
26
/**
27
27
* Make the current directory the root directory and preserve the boot partition
28
28
* in the "boot" subdirectory of the current directory.
29
29
* Returns 0 on success and -1 on errors.
30
30
*/
31
- int switch_root ();
31
+ int switch_root (void );
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ static void quit_hdl(int err)
31
31
exit (err );
32
32
}
33
33
34
- static int waitForEnter ()
34
+ static int waitForEnter (void )
35
35
{
36
36
fd = open (event_fn , O_RDONLY );
37
37
if (fd < 0 ) {
@@ -60,6 +60,7 @@ int main(int argc, char **argv)
60
60
if (fork ())
61
61
execl (init_fn , "/init" , NULL );
62
62
63
+ (void )argc ;
63
64
strlcpy (argv [0 ], process_name , strlen (argv [0 ]));
64
65
65
66
int res = waitForEnter ();
Original file line number Diff line number Diff line change 10
10
#include "mininit.h"
11
11
12
12
13
- const char * mount_boot ()
13
+ const char * mount_boot (void )
14
14
{
15
15
return "/" ;
16
16
}
17
17
18
- int open_dir_to_clean ()
18
+ int open_dir_to_clean (void )
19
19
{
20
20
return -1 ;
21
21
}
22
22
23
- int switch_root ()
23
+ int switch_root (void )
24
24
{
25
25
DEBUG ("Pivoting root\n" );
26
26
if (syscall (SYS_pivot_root , "." , "boot" )) {
You can’t perform that action at this time.
0 commit comments