int cat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int cat_main(int argc UNUSED_PARAM, char **argv)
{
+#if ENABLE_FEATURE_CATV || ENABLE_FEATURE_CATN
unsigned opts;
- opts = getopt32(argv, IF_FEATURE_CATV("^")
+ opts =
+#endif
+ getopt32(argv, IF_FEATURE_CATV("^")
/* -u is ignored ("unbuffered") */
IF_FEATURE_CATV("etvA")IF_FEATURE_CATN("nb")"u"
IF_FEATURE_CATV("\0" "Aetv" /* -A == -vet */)
int opt;
#if ENABLE_FEATURE_LS_FILETYPES || ENABLE_FEATURE_LS_COLOR
struct stat statbuf;
- char append;
#endif
-
#if ENABLE_FEATURE_LS_FILETYPES
- append = append_char(dn->dn_mode);
+ char append = append_char(dn->dn_mode);
#endif
+
opt = option_mask32;
/* Do readlink early, so that if it fails, error message
IF_FEATURE_STAT_FORMAT(char *format = NULL;)
int i;
int ok;
- unsigned opts;
statfunc_ptr statfunc = do_stat;
+#if ENABLE_FEATURE_STAT_FILESYSTEM || ENABLE_SELINUX
+ unsigned opts;
- opts = getopt32(argv, "^"
+ opts =
+#endif
+ getopt32(argv, "^"
"tL"
IF_FEATURE_STAT_FILESYSTEM("f")
IF_SELINUX("Z")
{
uname_info_t uname_info;
IF_UNAME(const char *unknown_str = "unknown";)
- unsigned toprint;
-
- toprint = (1 << 4); /* "arch" = "uname -m" */
-
#if ENABLE_UNAME
+ unsigned toprint = (1 << 4); /* "arch" = "uname -m" */
+
if (!ENABLE_BB_ARCH || applet_name[0] == 'u') {
# if ENABLE_LONG_OPTS
static const char uname_longopts[] ALIGN1 =
lib-$(CONFIG_FEATURE_CHECK_NAMES) += die_if_bad_username.o
lib-$(CONFIG_NC) += udp_io.o
+lib-$(CONFIG_NETCAT) += udp_io.o
lib-$(CONFIG_DNSD) += udp_io.o
lib-$(CONFIG_NTPD) += udp_io.o
lib-$(CONFIG_TFTP) += udp_io.o
# define CHAR_T char
# define BB_isspace(c) isspace(c)
# if ENABLE_FEATURE_EDITING_VI
-static bool BB_isalnum_or_underscore(CHAR_T c) {
+static bool BB_isalnum_or_underscore(CHAR_T c)
+{
return ((unsigned)c < 256 && isalnum(c)) || c == '_';
}
# endif
int addgroup_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int addgroup_main(int argc UNUSED_PARAM, char **argv)
{
+#if ENABLE_FEATURE_ADDUSER_TO_GROUP
unsigned opts;
+#endif
const char *gid = "0";
/* need to be root */
* addgroup --gid num group
* addgroup user group
* Check for min, max and missing args */
- opts = getopt32long(argv, "^" "g:S" "\0" "-1:?2", addgroup_longopts,
+#if ENABLE_FEATURE_ADDUSER_TO_GROUP
+ opts =
+#endif
+ getopt32long(argv, "^" "g:S" "\0" "-1:?2", addgroup_longopts,
&gid
);
/* move past the commandline options */
test -f include/applets.h || { echo "No include/applets.h file"; exit 1; }
apps="`
grep ^IF_ include/applets.h \
-| grep -v ^IF_FEATURE_ \
+| grep -v '^IF_FEATURE_' \
| sed 's/IF_\([A-Z0-9._-]*\)(.*/\1/' \
+| grep -v '^BUSYBOX$' \
| sort | uniq
`"
#define G_error_pkt_reason (G.error_pkt[3])
#define G_error_pkt_str ((char*)(G.error_pkt + 4))
-#if ENABLE_FEATURE_TFTP_PROGRESS_BAR
+#if ENABLE_FEATURE_TFTP_PROGRESS_BAR && ENABLE_FEATURE_TFTP_BLOCKSIZE
static void tftp_progress_update(void)
{
bb_progress_update(&G.pmt, 0, G.pos, G.size);
}
}
#else
+# define tftp_progress_update() ((void)0)
# define tftp_progress_init() ((void)0)
# define tftp_progress_done() ((void)0)
#endif
{
char *arg;
pid_t pid;
- int signo = SIGTERM, errors = 0, quiet = 0;
+ int signo = SIGTERM, errors = 0;
+#if ENABLE_KILL || ENABLE_KILLALL
+ int quiet = 0;
+#endif
#if KILL_APPLET_CNT == 1
# define is_killall ENABLE_KILLALL
/* The -q quiet option */
if (is_killall && arg[1] == 'q' && arg[2] == '\0') {
+#if ENABLE_KILL || ENABLE_KILLALL
quiet = 1;
+#endif
arg = *++argv;
if (!arg)
bb_show_usage();
continue
fi
fi
+ grep -i 'warning:' "$dir/make.log"
rm -rf -- "$dir"
let cnt++
done
switch (cmdentry.cmdtype) {
default: {
-#if ENABLE_FEATURE_SH_NOFORK
+#if ENABLE_FEATURE_SH_NOFORK && NUM_APPLETS > 1
/* (1) BUG: if variables are set, we need to fork, or save/restore them
* around run_nofork_applet() call.
* (2) Should this check also be done in forkshell()?
return EXIT_SUCCESS;
}
-#if ENABLE_HUSH_UNSET
+#if ENABLE_HUSH_UNSET || ENABLE_HUSH_GETOPTS
static int unset_local_var(const char *name)
{
return unset_local_var_len(name, strlen(name));
free(strings);
}
-#if BASH_HOSTNAME_VAR || ENABLE_FEATURE_SH_MATH || ENABLE_HUSH_READ
+#if BASH_HOSTNAME_VAR || ENABLE_FEATURE_SH_MATH || ENABLE_HUSH_READ || ENABLE_HUSH_GETOPTS
static void FAST_FUNC set_local_var_from_halves(const char *name, const char *val)
{
char *var = xasprintf("%s=%s", name, val);
static char *encode_then_expand_string(const char *str, int process_bkslash, int do_unbackslash)
{
#if !BASH_PATTERN_SUBST
- const int do_unbackslash = 1;
+ enum { do_unbackslash = 1 };
#endif
char *exp_str;
struct in_str input;
return rcode;
}
- if (ENABLE_FEATURE_SH_NOFORK) {
+ if (ENABLE_FEATURE_SH_NOFORK && NUM_APPLETS > 1) {
int n = find_applet_by_name(argv_expanded[0]);
if (n >= 0 && APPLET_IS_NOFORK(n)) {
rcode = redirect_and_varexp_helper(&new_env, &old_vars, command, &squirrel, argv_expanded);
rword, cond_code, last_rword);
sv_errexit_depth = G.errexit_depth;
- if (IF_HAS_KEYWORDS(rword == RES_IF || rword == RES_ELIF ||)
+ if (
+#if ENABLE_HUSH_IF
+ rword == RES_IF || rword == RES_ELIF ||
+#endif
pi->followup != PIPE_SEQ
) {
G.errexit_depth++;