Commit Graph

671 Commits

Author SHA1 Message Date
Rob Landley
290fcb4213 Undo all of the ugliness and some of the bloat from 15412. 2006-06-18 23:59:03 +00:00
Rob Landley
ea224be6aa skip_whitespace() shouldn't claim its return value is const, it doesn't know
that and callers wind up typecasting it back.
2006-06-18 20:20:07 +00:00
Rob Landley
148734df99 We came up with our own names for ATTRIBUTE_*, so why check if they're already
#defined?  Also remove a check for a gcc version older than RH9 (if non-linux
needs that #define they can put it in their section.)
2006-06-15 16:00:42 +00:00
Rob Landley
22d26fc6ae Patch from Yann Morin to put BLKGETSIZE64 in platform.h had rather a lot of
fallout due to the #include <sys/mount.h>.  Removed that #include from various
applets and fixed up those that were unhappy when that #include was made
because they'd block copied stuff out of it.  (Sigh.)
2006-06-15 15:49:36 +00:00
Rob Landley
c7ddefc062 Attempt at fixing bug 815 by upgrading bb_spawn() so that builtins are at
the start of the path.  (This should be under the same config option as
the standalone shell, but right now that's buried in the shell menu.)

Also add the ability to specify CONFIG_BUSYBOX_EXEC_PATH with /proc/self/exe
as an overrideable default.
2006-06-14 01:24:33 +00:00
Rob Landley
18958e9309 Random cleanup of platform.h. 2006-06-13 18:28:33 +00:00
Bernhard Reutner-Fischer
a926f8e50a - add fancy mode to start-stop-daemon to support --oknodo and --verbose 2006-06-11 17:24:01 +00:00
Paul Fox
6ba8bbe88a add ordering warning on enum Location 2006-06-09 12:25:10 +00:00
Paul Fox
6ab037872f made "test" an ash built-in.
moved the contents of libbb/bb_echo.c back into coreutils/echo.c,
which is a more reasonable place for them than libbb.  this
forces anyone who wants echo and test to be builtin to ash to
also have them available as applets.  their cost is very small,
and the number of people who wouldn't want them as applets is
also very small.

added warning about shell builtins vs. CONFIG_FEATURE_SH_STANDALONE_SHELL,
which conflicts with their use.

thanks to nathanael copa for debugging help.

some string size optimization in test.c may have been lost with
this commit, but this is a good new baseline.
2006-06-08 21:37:26 +00:00
Mike Frysinger
2e7dfc179c need prototype for new vfork_daemon() 2006-06-07 21:58:57 +00:00
Rob Landley
6d8ce170b0 Fix from Tito to read from stdin only when it's not a tty. 2006-06-07 21:22:42 +00:00
Bernhard Reutner-Fischer
19008b8373 - reuse strings and messages. Saves about 600B 2006-06-07 20:17:41 +00:00
Bernhard Reutner-Fischer
16d3e4e0af - add applet taskset to set/retrieve the CPU affinity of a process
text    data     bss     dec     hex filename
    584       0       0     584     248 taskset.o.gcc-2.95
    509       0       0     509     1fd taskset.o.gcc-3.3
    505       0       0     505     1f9 taskset.o.gcc-3.4
    506       0       0     506     1fa taskset.o.gcc-4.0
    498       0       0     498     1f2 taskset.o.gcc-4.1
    495       0       0     495     1ef taskset.o.gcc-4.2-HEAD
2006-06-07 15:44:59 +00:00
Mike Frysinger
b16b5bb08f only check __GNU_LIBRARY__ if it is actually defined 2006-06-06 06:00:20 +00:00
Rob Landley
362dc2bf33 Header cleanup on two more networking files (move libbb.h to the top and
remove #includes that libbb.h already does), plus a minor cleanup of
libbb.h to move #includes towards the top of the file where we can see 'em.
2006-06-05 17:35:24 +00:00
Paul Fox
f0327f8e98 fix fdflish typo (reported by erik hovland) 2006-06-02 03:37:16 +00:00
Rob Landley
8fc32d9326 Shaun Jackman pointed out that KERNEL_VERSION() is used without guards, so
defining it in a guard is silly.
2006-06-01 00:52:30 +00:00
Rob Landley
317a45cb62 The common case APPLET() macro only needs three arguments. 2006-06-01 00:51:38 +00:00
Rob Landley
0620841758 Patch from Tito to remove long options from hdparm. 2006-05-31 22:52:57 +00:00
Rob Landley
b623a542df Header file cleanup. platform.h apparently needs to be included early on so it
can figure out what header files to include, and override stuff that comes
later.  But applets shouldn't include platform.h directly, they should include
busybox.h or libbb.h.  Since busybox.h already includes libbb.h, move libbb.h
to the top of busybox.h and platform.h near the top of libbb.h (right after
bbconfig.h, which is something platform.h also needs access to).

While we're at it, move some stuff from busybox.h to libbb.h so we have one
big file to audit/clean up/try to make sense of instead of many.
2006-05-31 22:09:03 +00:00
Rob Landley
8abbee474c Add catv (separate applet instead of cat -v). Also cleanup cat.c comments,
the following of which (from cat.c) belongs in svn history instead of the
source code:

/* Mar 16, 2003      Manuel Novoa III   (mjn3@codepoet.org)
 *
 * This is a new implementation of 'cat' which aims to be SUSv3 compliant.
 *
 * Changes from the previous implementation include:
 * 1) Multiple '-' args are accepted as required by SUSv3.  The previous
 *    implementation would close stdin and segfault on a subsequent '-'.
 * 2) The '-u' options is required by SUSv3.  Note that the specified
 *    behavior for '-u' is done by default, so all we need do is accept
 *    the option.
 */
2006-05-31 19:36:04 +00:00
Bernhard Reutner-Fischer
c418d482ba - s/defined(__uClinux__)/BB_NOMMU/
This needs a second pass to:
+ add bb_daemon(unsigned char no_chdir, unsigned char no_close, const char*flag)
+ eventually globally export argc and argv, so we don't need to pass it to
  bb_daemon().
2006-05-31 10:19:51 +00:00
Bernhard Reutner-Fischer
507cd755a4 - conditionally define BB_NOMMU 2006-05-31 10:04:03 +00:00
Rob Landley
752f0a6001 Put parentheses around some of the SWAP() macros, as pointed out by Peter
Kjellerstedt.
2006-05-30 06:28:03 +00:00
Rob Landley
bba7f08d27 Add SWAP_LE?? and SWAP_BE?? macros, and make things use them. Converts values
to/from little endian or big endian, which is a NOP if that's what the current
platform already is.
2006-05-29 05:51:12 +00:00
Rob Landley
9755197448 This is not C++. 2006-05-29 05:21:29 +00:00
Rob Landley
15d20a03d6 Remove _() and N_() from platform.h. #define them as NOP macros in the two
files still using them.  I didn't remove them from e2fsck.c to avoid stomping
pending cleanup patches from Garrett, and I didn't bother to remove them from
fdisk.c because that entire file needs to be rewritten from scratch.
2006-05-29 05:00:44 +00:00
Rob Landley
81dab2cf83 Fix hdparm to use PRIu64 instead of typecasting to long long (which is 128 bits
on 64 bit platforms), and move #include <inttypes.h> to libbb.h.
2006-05-28 01:56:08 +00:00
Rob Landley
8fba99f35e Move portability stuff to platform.h, and clean up adjtimex.c a bit while
I'm in the area.
2006-05-27 22:08:01 +00:00
Rob Landley
299a6b4d7b Consolidate #include <sys/time.h> so libbb.h does it. 2006-05-27 21:42:58 +00:00
Rob Landley
8bb50782a5 Change llist_add_* to take the address of the list rather than returning the new
head, and change all the callers.
2006-05-26 23:44:51 +00:00
Rob Landley
5edc10275e Slight sanity fix: data is void *, not char *. And it's called data
almost everywhere, so be consistent.
2006-05-26 23:00:10 +00:00
Bernhard Reutner-Fischer
781e42d66c - introduce and use bb_path_wtmp_file for portability (saves 11 Bytes).
- fix last.c to also look at the double-underscore UT_ defines.
2006-05-26 14:41:40 +00:00
Bernhard Reutner-Fischer
8379053b11 - move llist to top of file so we can potentially use it in all prototypes easily 2006-05-26 13:54:07 +00:00
Bernhard Reutner-Fischer
4ed1f1d99d - add workaround for tar being broken since it uses a non-portable constant. 2006-05-26 13:34:25 +00:00
Bernhard Reutner-Fischer
e00fc16aaa - move libc checks from busybox.h to platform.h
- add ATTRIBUTE_ALWAYS_INLINE, endian handling for DEC UNIX, some more
  compiler dependent defines to platform.h
- add conditional bb_setpgrp define to platform.h
- remove superfluous specifying args from "#define fdprintf dprintf"
2006-05-26 13:10:10 +00:00
Mike Frysinger
fa6c4844b2 fix spelling mistakes 2006-05-26 01:48:17 +00:00
Rob Landley
399d2b5c24 Rich Felker suggested removing dprintf() from watch, and one thing led to
another... This adds bb_xspawn() support, which does vfork/exec.  (I don't
know why using a static instead of a local adds ~40 bytes, but using
the local doesn't work...)
2006-05-25 23:02:40 +00:00
Rob Landley
c020f5f518 New version of nohup that's much smaller, less paranoid, consistent,
vaguely portable, and licensed GPLv2 "or later".
2006-05-21 18:28:13 +00:00
Bernhard Reutner-Fischer
35017fb4fc - backout erroneously checked in snippet.. 2006-05-19 20:48:22 +00:00
Rob Landley
80b8ff07ca A pending item in my tree I might as well check in: I plan to migrate calloc()
and bb_calloc() calls to bb_xzalloc() which allocates prezeroed memory but
only takes one argument (the size).
2006-05-19 20:36:49 +00:00
Bernhard Reutner-Fischer
b1629b1b2a - remove emacs layout block as suggested by Robert P.J. Day
- use shorter boilerplate while at it
2006-05-19 19:29:19 +00:00
Mike Frysinger
cf89c37d08 fix indenting in help output for ifconfig 2006-05-19 16:14:31 +00:00
Bernhard Reutner-Fischer
e2e56c7c41 - single KERNEL_VERSION(a,b,c) macro in platform.h
- rename get_kernel_revision() to get_linux_version_code
from Robert P. J. Day
2006-05-19 11:54:02 +00:00
Rob Landley
2686d3bc38 Rob Sullivan cleaned up the longstanding patch from Hideki IWAMOTO to add
ibs and obs support to dd, and made it configurable.  I cleaned it up a bit
further and moved conv= into the same config option.
2006-05-16 16:52:12 +00:00
Rob Landley
34b5319d86 Make md5 calculation always go through an the buffer so that A) we don't
handle packets out of sequence if some data goes through the buffer and
some doesn't, B) it works on systems that can't handle aligned access,
C) we just have one code path to worry about.

While we're at it, sizeof() and RESERVE_CONFIG_BUFFER() really don't combine
well, which is why md5sum has been reading and processing data 4 bytes at a
time.  I suspect that the existence of CONFIG_MD5_SIZE_VS_SPEED to do loop
unrolling and such in the algorithm was an attempt to work around that bug.
2006-05-16 02:38:26 +00:00
Paul Fox
d7384296f6 implement -print0 for find 2006-05-12 14:47:20 +00:00
Rob Landley
a6b5b60942 Fiddling with llist to make memory management easier. Specifically, the
option to delete the contents of the list when we delete the list is a
good thing.
2006-05-08 19:03:07 +00:00
Mike Frysinger
7031f62d9b add back in udhcp support 2006-05-08 03:20:50 +00:00
Rob Landley
63e4c637cb The udhcp was deleted from busybox in 14634. Bolting an external project to
the side of the tree doesn't _COUNT_, and I will not ship it.

Udhcp was deleted shortly after I posted my philosophy for what should and
shouldn't go into busybox:

http://www.busybox.net/lists/busybox/2006-March/019484.html

I complained about the change t the time.  I've complained repeatedly since.
But nobody felt like fixing it.  External dependencies are something to be
minimized.  I don't care about the ability for packages to build outside
busybox: something is either part of busybox, or it isn't.  If I convert any
part of the external udhcp repository to use libbb, I've broken the external
package.  Any random cleanups that touch that directory suddenly have to worry
about external dependencies that are NOT OUR PROBLEM.  Therefore, that
directory is not and cannot be part of busybox.  Wishful thinking isn't going
to change that.  I will not ship something I can't maintain.

I'll try to get a new dhcp client and server in before the ship window closes,
but I have a half-dozen other projects pending.  I'm sorry this happened, but
I'm not the one who removed it, and I'm not the one who ignored the project
maintainer's repeated complaints about the situation for the next month and a
half.
2006-05-07 23:19:20 +00:00