aboutsummaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-07-06 04:39:08 +0000
committerMike Frysinger <vapier@gentoo.org>2005-07-06 04:39:08 +0000
commit95ef16528cd90023244ee459d865f8770d164ac0 (patch)
tree5d071d726cff05f4201e6ced5b77ed6278e82c8c /init/init.c
parent72a4c33568561095fe8d43c8b6f07654c3f593a1 (diff)
downloadbusybox-w32-95ef16528cd90023244ee459d865f8770d164ac0.tar.gz
busybox-w32-95ef16528cd90023244ee459d865f8770d164ac0.tar.bz2
busybox-w32-95ef16528cd90023244ee459d865f8770d164ac0.zip
2005-07-05 Shaun Jackman <sjackman@gmail.com>
* init/Config.in (CONFIG_FEATURE_INIT_SWAPON): New option. * init/init.c (check_memory): Disable the swapon feature unless CONFIG_FEATURE_INIT_SWAPON is defined.
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/init/init.c b/init/init.c
index e0e2f19fb..528122580 100644
--- a/init/init.c
+++ b/init/init.c
@@ -309,6 +309,7 @@ static void set_term(int fd)
309 tcsetattr(fd, TCSANOW, &tty); 309 tcsetattr(fd, TCSANOW, &tty);
310} 310}
311 311
312#ifdef CONFIG_FEATURE_INIT_SWAPON
312/* How much memory does this machine have? 313/* How much memory does this machine have?
313 Units are kBytes to avoid overflow on 4GB machines */ 314 Units are kBytes to avoid overflow on 4GB machines */
314static unsigned int check_free_memory(void) 315static unsigned int check_free_memory(void)
@@ -337,6 +338,7 @@ static unsigned int check_free_memory(void)
337 return(result * u); 338 return(result * u);
338 } 339 }
339} 340}
341#endif /* CONFIG_FEATURE_INIT_SWAPON */
340 342
341static void console_init(void) 343static void console_init(void)
342{ 344{
@@ -910,6 +912,7 @@ static void delete_init_action(struct init_action *action)
910 } 912 }
911} 913}
912 914
915#ifdef CONFIG_FEATURE_INIT_SWAPON
913/* Make sure there is enough memory to do something useful. * 916/* Make sure there is enough memory to do something useful. *
914 * Calls "swapon -a" if needed so be sure /etc/fstab is present... */ 917 * Calls "swapon -a" if needed so be sure /etc/fstab is present... */
915static void check_memory(void) 918static void check_memory(void)
@@ -937,6 +940,9 @@ static void check_memory(void)
937 message(CONSOLE, "Sorry, your computer does not have enough memory."); 940 message(CONSOLE, "Sorry, your computer does not have enough memory.");
938 loop_forever(); 941 loop_forever();
939} 942}
943#else
944# define check_memory()
945#endif /* CONFIG_FEATURE_INIT_SWAPON */
940 946
941/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined, 947/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
942 * then parse_inittab() simply adds in some default 948 * then parse_inittab() simply adds in some default