summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2009-11-27 02:35:15 +0100
committerDenys Vlasenko2009-11-27 02:35:15 +0100
commit160b9ca7318fb63e9432c1028f52373aea6166f9 (patch)
tree9332d87a07380d9df65858e4d3779b5130ed02f3
parent1361aa2e2d80cb144b4158722de3c913855e6002 (diff)
downloadbusybox-160b9ca7318fb63e9432c1028f52373aea6166f9.zip
busybox-160b9ca7318fb63e9432c1028f52373aea6166f9.tar.gz
ntpd: make it NOMMU-safe; ash: exclude it on NOMMU builds
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ntpd.c16
-rw-r--r--shell/Config.in2
2 files changed, 10 insertions, 8 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 156cad6..c374120 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -892,6 +892,14 @@ static NOINLINE void ntp_init(char **argv)
&peers, &G.verbose);
if (!(opts & (OPT_p|OPT_l)))
bb_show_usage();
+ if (opts & OPT_g)
+ G.settime = 1;
+ while (peers)
+ add_peers(llist_pop(&peers));
+ if (!(opts & OPT_n)) {
+ bb_daemonize_or_rexec(DAEMON_DEVNULL_STDIO, argv);
+ logmode = LOGMODE_NONE;
+ }
#if ENABLE_FEATURE_NTPD_SERVER
G.listen_fd = -1;
if (opts & OPT_l) {
@@ -900,14 +908,6 @@ static NOINLINE void ntp_init(char **argv)
setsockopt(G.listen_fd, IPPROTO_IP, IP_TOS, &const_IPTOS_LOWDELAY, sizeof(const_IPTOS_LOWDELAY));
}
#endif
- if (opts & OPT_g)
- G.settime = 1;
- while (peers)
- add_peers(llist_pop(&peers));
- if (!(opts & OPT_n)) {
- logmode = LOGMODE_NONE;
- bb_daemonize(DAEMON_DEVNULL_STDIO);
- }
/* I hesitate to set -20 prio. -15 should be high enough for timekeeping */
if (opts & OPT_N)
setpriority(PRIO_PROCESS, 0, -15);
diff --git a/shell/Config.in b/shell/Config.in
index 998672c..8a26540 100644
--- a/shell/Config.in
+++ b/shell/Config.in
@@ -15,6 +15,7 @@ choice
config FEATURE_SH_IS_ASH
select ASH
bool "ash"
+ depends on !NOMMU
config FEATURE_SH_IS_HUSH
select HUSH
@@ -36,6 +37,7 @@ endchoice
config ASH
bool "ash"
default n
+ depends on !NOMMU
help
Tha 'ash' shell adds about 60k in the default configuration and is
the most complete and most pedantically correct shell included with