config: disentangle PREFER_APPLETS from SH_STANDALONE and SH_NOFORK
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 22 Jul 2016 16:48:38 +0000 (18:48 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 22 Jul 2016 16:48:38 +0000 (18:48 +0200)
On user request.
I thought enabling/disabling them all together is more consistent.
Evidently, some people do want them to be separately selectable.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
applets/applet_tables.c
include/busybox.h
libbb/vfork_daemon_rexec.c
shell/Config.src

index 843f2ec081bfa8f425bb6ce8bbda6c820323ede1..8401a15495c435f12c0fb1ed22da42dbbe60a6c7 100644 (file)
@@ -143,7 +143,9 @@ int main(int argc, char **argv)
        printf("};\n");
        printf("#endif\n\n");
 
-#if ENABLE_FEATURE_PREFER_APPLETS
+#if ENABLE_FEATURE_PREFER_APPLETS \
+ || ENABLE_FEATURE_SH_STANDALONE \
+ || ENABLE_FEATURE_SH_NOFORK
        printf("const uint8_t applet_flags[] ALIGN1 = {\n");
        i = 0;
        while (i < NUM_APPLETS) {
index 737627bd0df7a75bfb3637690e0752f855f89c95..6a003d544497ee6e8376abfd125fba9cd26b6514 100644 (file)
@@ -19,7 +19,9 @@ extern const uint8_t applet_flags[] ALIGN1;
 extern const uint8_t applet_suid[] ALIGN1;
 extern const uint8_t applet_install_loc[] ALIGN1;
 
-#if ENABLE_FEATURE_PREFER_APPLETS
+#if ENABLE_FEATURE_PREFER_APPLETS \
+ || ENABLE_FEATURE_SH_STANDALONE \
+ || ENABLE_FEATURE_SH_NOFORK
 # define APPLET_IS_NOFORK(i) (applet_flags[(i)/4] & (1 << (2 * ((i)%4))))
 # define APPLET_IS_NOEXEC(i) (applet_flags[(i)/4] & (1 << ((2 * ((i)%4))+1)))
 #else
index 1adb5b3c4155e5ab81211adfd26de6e59fc4b6f5..c192829b55fca8388f3f356a94c15d2314dd6e03 100644 (file)
@@ -68,7 +68,8 @@ pid_t FAST_FUNC xspawn(char **argv)
        return pid;
 }
 
-#if ENABLE_FEATURE_PREFER_APPLETS
+#if ENABLE_FEATURE_PREFER_APPLETS \
+ || ENABLE_FEATURE_SH_NOFORK
 static jmp_buf die_jmp;
 static void jump(void)
 {
@@ -174,7 +175,7 @@ int FAST_FUNC run_nofork_applet(int applet_no, char **argv)
 
        return rc & 0xff; /* don't confuse people with "exitcodes" >255 */
 }
-#endif /* FEATURE_PREFER_APPLETS */
+#endif /* FEATURE_PREFER_APPLETS || FEATURE_SH_NOFORK */
 
 int FAST_FUNC spawn_and_wait(char **argv)
 {
index b31e62ddac3ae76b8322baf4c2d17ae9afe6dd3a..e4df35973c1f01d3d550a6dc78cf01b9dfc2c016 100644 (file)
@@ -88,7 +88,7 @@ config FEATURE_SH_EXTRA_QUIET
 config FEATURE_SH_STANDALONE
        bool "Standalone shell"
        default n
-       depends on (HUSH || ASH) && FEATURE_PREFER_APPLETS
+       depends on (HUSH || ASH)
        help
          This option causes busybox shells to use busybox applets
          in preference to executables in the PATH whenever possible. For
@@ -121,7 +121,7 @@ config FEATURE_SH_STANDALONE
 config FEATURE_SH_NOFORK
        bool "Run 'nofork' applets directly"
        default n
-       depends on (HUSH || ASH) && FEATURE_PREFER_APPLETS
+       depends on (HUSH || ASH)
        help
          This option causes busybox shells to not execute typical
          fork/exec/wait sequence, but call <applet>_main directly,