diff --git a/init.c b/init.c index 14efa46..754598f 100644 --- a/init.c +++ b/init.c @@ -66,7 +66,7 @@ char *init_premount[] = {"/sbin/init-premount", "init-premount", NULL}; char *init_bottom[] = {"/sbin/init-bottom", "init-bottom", NULL}; extern void stage1(); -void fatal(const char *) __attribute__((noreturn)); +static void fatal(const char *) __attribute__((noreturn)); /* * this needs to handle the following cases: @@ -77,14 +77,14 @@ void fatal(const char *) __attribute__((noreturn)); * 4) run from a floppy that's been loaded into a ramdisk */ -void fatal(const char *msg) +static void fatal(const char *msg) { printf("FATAL ERROR IN INIT: %s\nI can't recover from this," "please reboot manually and send bugreport.\n", msg); while (1); } -void warn(char *msg) +static void warn(char *msg) { printf("W: %s\n", msg); } @@ -104,7 +104,7 @@ static int _mknod(const char *pathname, mode_t mode, dev_t dev) * (1) watch /proc/kmsg and copy the stuff to /dev/tty4 * (2) listens to /dev/log and copy also this stuff (log from programs) */ -pid_t doklog() +static pid_t doklog() { int in, out, i, ii; pid_t pid; @@ -151,7 +151,7 @@ pid_t spawn(char *av[]) } } -void spawn_hook(char *av[]) +static void spawn_hook(char *av[]) { struct stat st; int status; @@ -160,7 +160,7 @@ void spawn_hook(char *av[]) if (waitpid(spawn(av), &status, 0) < 0 || !(WIFEXITED(status))) fatal(av[0]); } -void take_env(int fd) +static void take_env(int fd) { static char buf[PIPE_BUF]; char *p = buf; @@ -285,7 +285,7 @@ struct filesystem }; /* attempt to unmount all filesystems in /proc/mounts */ -void unmount_filesystems(void) +static void unmount_filesystems(void) { int fd, size; char buf[65535]; /* this should be big enough */ diff --git a/init.h b/init.h new file mode 100644 index 0000000..7a28d81 --- /dev/null +++ b/init.h @@ -0,0 +1,22 @@ +/* + * Guillaume Cottenceau (gc@mandrakesoft.com) + * + * Copyright 2000 MandrakeSoft + * + * This software may be freely redistributed under the terms of the GNU + * public license. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#ifndef _INIT_H +#define _INIT_H + +#include + +pid_t spawn(char *av[]); + +#endif diff --git a/stage1.c b/stage1.c index e1e7126..d719dec 100644 --- a/stage1.c +++ b/stage1.c @@ -59,6 +59,10 @@ #include "disk.h" #endif +#ifdef SPAWN_SPLASH +#include "init.h" +#endif + extern char *env[]; /************************************************************ diff --git a/tools.c b/tools.c index 1b749bc..674b777 100644 --- a/tools.c +++ b/tools.c @@ -42,7 +42,9 @@ #include #include "tools.h" #include "modules.h" - +#ifdef SPAWN_SPLASH +#include "init.h" +#endif static struct param_elem params[50]; static int param_number = 0;