For each CONFIG_SYMBOL, include/bb_config.h now has both ENABLE_SYMBOL
and USE_SYMBOL(x). ENABLE_SYMBOL is still always defined (1 or 0) so that
if(ENABLE) should optimize out when it's zero. The USE_SYMBOL(X) will only
splice in X if the symbol is defined, otherwise it'll be empty.
Thus we can convert this:
#ifdef CONFIG_ARGS
opt = bb_getopt_ulflags(argc, argv, "ab:c"
#ifdef CONFIG_THINGY
"d:"
#endif
, &bvalue
#ifdef CONFIG_THINGY
, &thingy
#endif
);
#endif
into this:
if (ENABLE_ARGS) {
opt = bb_getopt_ulflags(argc, argv, "ab:c" USE_THINGY("d:"), &bvalue
USE_THINGY(, &thingy));
}
And it should produce the same code.
Unlike the old versions in include/_usage.h, the new USE_SYMBOL(x) can handle
commas in its arguments (as shown above). (The _usage.h file is obsolete and
no longer generated.)
Nobody should need to include config.h directly anymore, bb_config.h should
define all the configuration stuff we need. Someday, the CONFIG_SYMBOL
versions should go away in favor of ENABLE_SYMBOL and USE_SYMBOL().
Thanks to vodz for the new version of bb_mkdep.c that works with function
macros.
Somehow while applying the bb_do_delay patch a change slipped
in libbb.h that broke compilation.
libbb.h Line 355
extern char bb_path_mtab_file[];
This conflicts with mtab_file.c
#if defined(CONFIG_FEATURE_MTAB_SUPPORT)
const char bb_path_mtab_file[] = "/etc/mtab";
#else
const char bb_path_mtab_file[] = "/proc/mounts";
#endif
Not buying it, eh?
I know I said new features before 1.1, but, well... (I was weak!)
The config file and hotplug modes aren't implemented yet. Might take a stab at
those tomorrow. (I _should_ go back to focusing on the bug triage list.)
CONFIG_ symbol in the kernel, and this clashes with busybox's CONFIG_TR
and CONFIG_WATCHDOG, causing applets.h to barf if they're not switched
on (since the broken headers don't affect kconfig or the makefiles).
Since such broken kernel headers are common enough to crop up every few
months, a simple work around is to move TR and WATCHDOG from CONFIG_
to ENABLE_ early.
messages, C) can show the current association (if any) when called
with only one argument. Update the documentation a lot too.
Remind me to add a test suite for this thing. I think I've figured out
how to handle root-only testsuites...
fixes bug #113 and satisfies a personal need at the same time.
output compares identically to util-linux version. (with
exception of whitespace differences on last lines of output with
non-uniform length, which are neither fixed nor worsened by this
change.)
- change llist_add_to_end as proposed by vodz in http://busybox.net/lists/busybox/2005-September/016411.html
- remove unneeded includes, add short boilerplate and copyright to llist.c
- move COMM_LEN from find_pid_by_name to libbb.h and use it in procps_status_t
- add reverse_pidlist() to find_pid_by_name. Will be needed for pidof.
- move to ENABLE_ and use shorter boilerplate.
sizes without selinux-support:
text data bss dec hex filename
356 0 0 356 164 procps/ps.o.with-w
300 0 0 300 12c procps/ps.o.no-w
302 0 0 302 12e procps/ps.o.oorig
This fixes the warning, and makes the binary smaller out of sheer pique.
(Yes, since Manuel did this one it's nice tight code that took several
attempts to shrink, but I was ticked.)
Add the start of a test for uniq; this is about the first 1/3 of the
tests we need for full susv3 coverage of uniq.
the result of the ioctl so callers can tell if we have a tty. (0 means
we have a tty, nonzero means the ioctl couldn't find size info and we
fake 80x24. Really we should fake 80x25, but oh well...)
things down a bit, fixed a number of funky corner cases, added support for
several new features (things like mount --move, mount --bind, lazy unounts,
automatic detection of loop mounts, and so on). Probably broke several
other things, but it's fixable. (Bang on it, tell me what doesn't work for
you...)
Note: you no longer need to say "-o loop". It does that for you when
necessary.
Still need to add "user mount" support, which involves making mount suid. Not
too hard to do under the new infrastructure, just haven't done it yet...
The previous code had the following notes, that belong in the version
control comments:
- * 3/21/1999 Charles P. Wright <cpwright@cpwright.com>
- * searches through fstab when -a is passed
- * will try mounting stuff with all fses when passed -t auto
- *
- * 1999-04-17 Dave Cinege...Rewrote -t auto. Fixed ro mtab.
- *
- * 1999-10-07 Erik Andersen <andersen@codepoet.org>.
- * Rewrite of a lot of code. Removed mtab usage (I plan on
- * putting it back as a compile-time option some time),
- * major adjustments to option parsing, and some serious
- * dieting all around.
- *
- * 1999-11-06 mtab support is back - andersee
- *
- * 2000-01-12 Ben Collins <bcollins@debian.org>, Borrowed utils-linux's
- * mount to add loop support.
- *
- * 2000-04-30 Dave Cinege <dcinege@psychosis.com>
- * Rewrote fstab while loop and lower mount section. Can now do
- * single mounts from fstab. Can override fstab options for single
- * mount. Common mount_one call for single mounts and 'all'. Fixed
- * mtab updating and stale entries. Removed 'remount' default.
- *
0000072: Add applet to redirect console output via ioctl(..., TIOCCONS)
applet name changed to setconsole, since suse has a very similar
utility. better to treat differences as bugs than invent a new command.
since simply defining the prototype in an internal header file doesnt hurt anyone, lets not worry about the header file crap and just always prototype the inet6 functions
Rob Landley, and others.
Currently CONFIG options are defined or undefined, so we chop out code with
#ifdefs, ala:
#ifdef CONFIG_THING
stuff();
#endif
This creates a new header file, bb_config.h, which sets the CONFIG entry to 1
or 0, and lets us do:
if(CONFIG_THING) stuff();
And let the compiler do dead code elimination to get rid of it. (Note: #ifdef
will still work because for the 1 case it's a static const int, not a #define.)
with tweaks from Mike Frysinger and Rob Landley.
Note: this will still fail to umount a path that contains an ' or \ character.
Is it worth the extra size to filter for that?
To: busybox@mail.codepoet.org
Wrap sockaddr_in6 in a ifdef CONFIG_FEATURE_IPV6.
Include sys/types.h instead of asm/types.h.
Include netinet/if_ether.h instead of linux/if_ether.h
The ioctl request argument is an int, not an unsigned short.