aboutsummaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorvapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-07-06 04:39:08 +0000
committervapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-07-06 04:39:08 +0000
commit828afaad5661eec494d15ebe54dbb02f78d1e239 (patch)
tree5d071d726cff05f4201e6ced5b77ed6278e82c8c /init/init.c
parent8c1554a4253be66272bafad8859af703d5e32c7d (diff)
downloadbusybox-w32-828afaad5661eec494d15ebe54dbb02f78d1e239.tar.gz
busybox-w32-828afaad5661eec494d15ebe54dbb02f78d1e239.tar.bz2
busybox-w32-828afaad5661eec494d15ebe54dbb02f78d1e239.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. git-svn-id: svn://busybox.net/trunk/busybox@10721 69ca8d6d-28ef-0310-b511-8ec308f3f277
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