Denis Vlasenko [Tue, 19 Sep 2006 14:31:44 +0000 (14:31 -0000)]
stty: reorder code, reducing need in forward declarations.
added few missed bits of error checking for parameters.
Denis Vlasenko [Tue, 19 Sep 2006 14:24:23 +0000 (14:24 -0000)]
stty: convert "enum mode_type" into unnamed enum
(reduces code obfuscation); deindent set_mode;
add _or_die suffixes to few functions
Denis Vlasenko [Tue, 19 Sep 2006 14:20:22 +0000 (14:20 -0000)]
stty: reduce #ifdef forest
Denis Vlasenko [Tue, 19 Sep 2006 14:19:42 +0000 (14:19 -0000)]
stty: simplify linewrapping code a bit
Denis Vlasenko [Tue, 19 Sep 2006 14:17:10 +0000 (14:17 -0000)]
stty: style fixes
Denis Vlasenko [Tue, 19 Sep 2006 14:16:28 +0000 (14:16 -0000)]
stty: fix a longstanding FIXME (was able to die half-way setting term params)
Denis Vlasenko [Tue, 19 Sep 2006 14:14:12 +0000 (14:14 -0000)]
mount: fstabname needs to be const char*
Denis Vlasenko [Tue, 19 Sep 2006 14:07:52 +0000 (14:07 -0000)]
mount: fix warning (printf field width of * wants int, not size_t)
Denis Vlasenko [Tue, 19 Sep 2006 13:50:55 +0000 (13:50 -0000)]
getty: #include <syslog.h>
Denis Vlasenko [Tue, 19 Sep 2006 09:55:09 +0000 (09:55 -0000)]
change char *string = "foo" -> char string[] = "foo"
function old new delta
xsetenv 45 44 -1
iproute_list_or_flush 1834 1833 -1
ipaddr_modify 1915 1914 -1
ipaddr_list_or_flush 1861 1860 -1
invarg 39 38 -1
do_set 1259 1258 -1
bb_verror_msg 268 267 -1
create_icmp_socket 142 140 -2
create_icmp6_socket 142 140 -2
bb_full_fd_action 324 322 -2
bb_path_mtab_file 10 - -10
.rodata 214796 214720 -76
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/11 up/down: 0/-99) Total: -99 bytes
Denis Vlasenko [Sun, 17 Sep 2006 16:28:10 +0000 (16:28 -0000)]
whitespace cleanup
Denis Vlasenko [Sun, 17 Sep 2006 15:51:52 +0000 (15:51 -0000)]
mount: style fixlet
Denis Vlasenko [Sun, 17 Sep 2006 15:45:48 +0000 (15:45 -0000)]
style fixes
Denis Vlasenko [Sun, 17 Sep 2006 15:39:22 +0000 (15:39 -0000)]
mount: revert mount --bind to using "bind" as fstype.
Denis Vlasenko [Sun, 17 Sep 2006 15:09:48 +0000 (15:09 -0000)]
mount: mount_it_now() - char *dir is not really needed.
Denis Vlasenko [Sun, 17 Sep 2006 15:08:12 +0000 (15:08 -0000)]
mount: fix "duplicate mount options in mtab" bug
Denis Vlasenko [Sun, 17 Sep 2006 15:06:34 +0000 (15:06 -0000)]
mount: nfs_strerror's static buffer was bigger than needed.
Denis Vlasenko [Sun, 17 Sep 2006 15:05:31 +0000 (15:05 -0000)]
mount: getopt_ulflag'ification
Denis Vlasenko [Sun, 17 Sep 2006 15:04:35 +0000 (15:04 -0000)]
mount: style fixes
Denis Vlasenko [Sun, 17 Sep 2006 15:04:01 +0000 (15:04 -0000)]
mount: fix bugs: free(mp->mnt_fsname) of non-malloced ptr;
check for "more than 2 arguments" was actually checking for -2.
Denis Vlasenko [Sun, 17 Sep 2006 15:01:53 +0000 (15:01 -0000)]
mount: use bb_simplify_path as appropriate
Denis Vlasenko [Sun, 17 Sep 2006 15:00:58 +0000 (15:00 -0000)]
mount: style fixes
Denis Vlasenko [Sun, 17 Sep 2006 14:45:09 +0000 (14:45 -0000)]
login: apply fixes + getopt_ulflag'ification by Bernhard
Bernhard Reutner-Fischer [Fri, 15 Sep 2006 19:25:18 +0000 (19:25 -0000)]
- Steven Scholz pointed out that ssd's make-pid doesn't take an argument.
Denis Vlasenko [Fri, 15 Sep 2006 15:12:00 +0000 (15:12 -0000)]
mount: reorder things, fix NFS-less mount.
Rob Landley [Fri, 15 Sep 2006 04:10:05 +0000 (04:10 -0000)]
Unbreak allbareconfig.
Rob Landley [Fri, 15 Sep 2006 04:08:25 +0000 (04:08 -0000)]
So, in the cornucopia of superfulous warning directives I didn't add to the
tree, we have the warning about failed inlines (which with our inline
limit set to zero means any usage of the "inline" keyword at all). Note
that setting the inline limit to zero, and using -Werror, both predated
adding the warning about inlines to the tree. So whatever checkin added
that did nothing but break the tree. But oh well.
The second category of superfluous warnings is warning about functions with
no previous declaration. Apparently, if you add ALWAYS_INLINE to an empty
function definition, it considers the sucker undeclared as far as the
warning is concerned. (I.E. it's a buggy warning. I try not to ask the
compiler to generate warnings it can't competently generate.)
This is why I removed "inline" (unbreak allbareconfig), and couldn't replace it
with "ALWAYS_INLINE" (still broke allbareconfig).
Rob Landley [Fri, 15 Sep 2006 04:01:03 +0000 (04:01 -0000)]
Unbreak allbareconfig.
We've had -Werror in the tree for quite a while, so adding #warning
somewhat counterproductve way to make comments on the code that belong on the
mailing list anyway.
Rob Landley [Thu, 14 Sep 2006 19:52:07 +0000 (19:52 -0000)]
Strangely, using // in the comments I added was not a persistent accident.
Denis Vlasenko [Thu, 14 Sep 2006 17:03:18 +0000 (17:03 -0000)]
login: eliminate forward decls and #ifdefs
Denis Vlasenko [Thu, 14 Sep 2006 16:40:46 +0000 (16:40 -0000)]
umount: do not try to close FILE* which is NULL.
Denis Vlasenko [Thu, 14 Sep 2006 16:09:27 +0000 (16:09 -0000)]
mount: -o remount should not add lines to /etc/mtab
Denis Vlasenko [Thu, 14 Sep 2006 15:46:33 +0000 (15:46 -0000)]
mount: move code from nfsmount.c into mount.c
Bernhard Reutner-Fischer [Thu, 14 Sep 2006 15:07:48 +0000 (15:07 -0000)]
- make sure that the 'build' dir exists even if we are about to build just one applet.
Bernhard Reutner-Fischer [Thu, 14 Sep 2006 15:04:31 +0000 (15:04 -0000)]
- do away with silly comment and do the Right Thing wrt building the archives.
You have to provide the absolute path to the objdir/target.ext you want to build, as can be seen in the respective makefiles..
Denis Vlasenko [Thu, 14 Sep 2006 13:19:19 +0000 (13:19 -0000)]
mount: fix mtab support (but it is still rather buggy)
Rob Landley [Thu, 14 Sep 2006 05:59:32 +0000 (05:59 -0000)]
svn 15355 replaced "BusyBox is licensed under the GNU General Public Public
License" with "BusyBox is licensed under the GNU General Public
License version 2 or later... (This is the same license the Linux kernel
is under...)" Except that the Linux kernel isn't under GPLv2 or later,
it's just under GPLv2.
Now they match again.
Rob Landley [Thu, 14 Sep 2006 05:27:28 +0000 (05:27 -0000)]
More code from kernel developers, and therefore licensed under GPLv2 only.
Clarify the license boilerplate.
On an unrelated note, this could use busyboxification. check_mount() looks
reusable and ask() is generic...
Rob Landley [Wed, 13 Sep 2006 19:54:36 +0000 (19:54 -0000)]
Add Larry Doolittle's ntpclient, plus some formatting tweaks.
Bernhard Reutner-Fischer [Wed, 13 Sep 2006 16:39:19 +0000 (16:39 -0000)]
- fix copy'n paste errors that got introduced when switching to the shorter boilerplate.
No object code changes.
Bernhard Reutner-Fischer [Wed, 13 Sep 2006 15:42:47 +0000 (15:42 -0000)]
- r16075 broke for de-selected FEATURE_UTMP; Partial fix that wants some more cleanup (see FIXME in the patch).
Rob Landley [Tue, 12 Sep 2006 22:42:03 +0000 (22:42 -0000)]
Revert duplicate patch.
I don't know why patch decided to apply this even though it was already in
the tree. I thought the other hunks failed because they were totally
unrelated leakage from Bernhard's tree (which they are; was the a reason
for bundling them in with this fix? Do they have something to do with
the GCC 2.95 fix? I suspect they prevent me from backporting this
patch to 1.2.2 because the header consolidation into libbb.h hadn't
been done yet, and no I'm not fixing it up: if that's the case then
this patch won't be in 1.2.2 due to extraneous changes bundled with it that
prevent a clean backport without rolling a new patch).
Rob Landley [Tue, 12 Sep 2006 21:42:17 +0000 (21:42 -0000)]
Remove pointless "const". Bloatcheck says 0 bytes difference.
Rob Landley [Tue, 12 Sep 2006 20:29:22 +0000 (20:29 -0000)]
Fix from Bernhard for somebody trying to limp along with gcc 2.95.4.
Rob Landley [Tue, 12 Sep 2006 20:28:34 +0000 (20:28 -0000)]
Random cleanup hanging around my tree.
Bernhard Reutner-Fischer [Tue, 12 Sep 2006 13:27:55 +0000 (13:27 -0000)]
- small trivia to be gentle to gcc-2.95.x which had no va_copy but only __va_copy.
Bernhard Reutner-Fischer [Tue, 12 Sep 2006 13:25:16 +0000 (13:25 -0000)]
- fix warning about discarding qualifiers in initialization
Denis Vlasenko [Mon, 11 Sep 2006 17:42:44 +0000 (17:42 -0000)]
nfsmount: sanitize it. It had a rather peculiar idea of implementing "bg"
option - it was going to return a special flag back to caller and
expecting caller to call it again with special parameter! Also
caller was charged with calling mount() syscall...
mount: mtab support was non-functional. Enabling it revealed serious bug
which is not fixed yet.
Bernhard Reutner-Fischer [Mon, 11 Sep 2006 16:01:40 +0000 (16:01 -0000)]
- convert a few xopen3(,,0) into xopen(,). Also peruse the fact that xopen defaults to 0777 on it's own, so we don't need to xopen3(,,0777).
Saves a few bytes:
$ size busybox.old busybox text data bss dec hex filename
839676 8780 243592
1092048 10a9d0 busybox.old
839660 8780 243592
1092032 10a9c0 busybox
$ make CC=gcc-4.2-HEAD bloatcheck
function old new delta
static.vconfig_main 281 279 -2
static.rx_main 1076 1074 -2
static.mt_main 294 292 -2
static.gzip_main 753 751 -2
static.mkfs_minix_main 4034 4030 -4
static.unzip_main 1771 1766 -5
static.crontab_main 1513 1507 -6
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/7 up/down: 0/-23) Total: -23 bytes
Bernhard Reutner-Fischer [Mon, 11 Sep 2006 09:18:09 +0000 (09:18 -0000)]
- merge xstat.c into xfuncs.c
Bernhard Reutner-Fischer [Mon, 11 Sep 2006 09:16:12 +0000 (09:16 -0000)]
- Tito pointed out that Rob forgot to add e2fsprogs/blkid/list.c
Rob Landley [Mon, 11 Sep 2006 01:34:21 +0000 (01:34 -0000)]
Build fixes for gcc 4.0 with -Werror, from Tito.
Rob Landley [Mon, 11 Sep 2006 00:34:01 +0000 (00:34 -0000)]
Error reporting fix for sulogin, plus remove help entries for options we never
implemented. (Plus a bit more of bbsh leaking in from my tree, but it
shouldn't hurt anything and I'm lazy...)
Denis Vlasenko [Sun, 10 Sep 2006 18:48:16 +0000 (18:48 -0000)]
nfsmount: remove some really old code (for kernels 1.x!) + small cleanups.
Denis Vlasenko [Sun, 10 Sep 2006 18:40:18 +0000 (18:40 -0000)]
nfsmount: delete nfsmount.h
Denis Vlasenko [Sun, 10 Sep 2006 18:38:17 +0000 (18:38 -0000)]
nfsmount: nfsmount.h merged into nfsmount.c
Denis Vlasenko [Sun, 10 Sep 2006 18:28:23 +0000 (18:28 -0000)]
nfsmount: style fix
Denis Vlasenko [Sun, 10 Sep 2006 18:26:51 +0000 (18:26 -0000)]
ipcs: silly trick with strings. saves ~200 bytes.
Rob Landley [Sun, 10 Sep 2006 03:20:37 +0000 (03:20 -0000)]
Cleanup headers and replace the zero padding with an even smaller version.
One of the pads turned out to be unnecessary: sizeof(struct TarHeader) is
TAR_BLOCK_SIZE, the padding's in the struct. The others could be done inline
with bb_common_bufsiz1.
This is a cleanup I did to Denis' patch long ago, but got sidetracked by
what turned into svn 15660.
Denis Vlasenko [Sat, 9 Sep 2006 14:00:58 +0000 (14:00 -0000)]
sulogin: minor cleanup.
Denis Vlasenko [Sat, 9 Sep 2006 13:23:04 +0000 (13:23 -0000)]
setkeycodes: something horrible happened here
to indentation... fixed now
Denis Vlasenko [Sat, 9 Sep 2006 12:55:02 +0000 (12:55 -0000)]
top: fixed wrong comment, made error message more clear
Denis Vlasenko [Sat, 9 Sep 2006 12:49:03 +0000 (12:49 -0000)]
tar: fix "xopen with O_CREAT" warning, improve zero padding write
(was doing zillions of 1-byte write syscalls)
Denis Vlasenko [Sat, 9 Sep 2006 12:25:20 +0000 (12:25 -0000)]
xopen3(O_RDONLY) -> xopen(O_RDONLY).
Denis Vlasenko [Sat, 9 Sep 2006 12:24:19 +0000 (12:24 -0000)]
using [xa]sprintf for string concatenation is neat and saves
~100 bytes according to bloatcheck. Also this fixes bug in rpm
Denis Vlasenko [Sat, 9 Sep 2006 12:20:57 +0000 (12:20 -0000)]
wget: wrap one atrociously long line (around 200 chars long!).
Denis Vlasenko [Sat, 9 Sep 2006 12:18:46 +0000 (12:18 -0000)]
udhcp: FEATURE_UDHCP_SYSLOG should be selected only if
udhcp[cd] really are going to use it.
Denis Vlasenko [Fri, 8 Sep 2006 17:56:52 +0000 (17:56 -0000)]
login: use some ideas from util-linux's login.
O_NONBLOCKing output on login timeout.
fchmod instead of chmod (latter is racy).
is_my_tty() is not needed anymore after race is fixed
(is_my_tty() was racy too anyway...).
Denis Vlasenko [Fri, 8 Sep 2006 17:31:55 +0000 (17:31 -0000)]
few random readability enhansements. No code changes
Denis Vlasenko [Fri, 8 Sep 2006 17:29:53 +0000 (17:29 -0000)]
login: make it saner and smaller by ~0.5k.
Denis Vlasenko [Fri, 8 Sep 2006 17:26:20 +0000 (17:26 -0000)]
login: small fixes like \n removal, bb_error_msg'ification, etc.
Denis Vlasenko [Fri, 8 Sep 2006 17:25:04 +0000 (17:25 -0000)]
login: previous commit comment was wrong :)
That commit added login script support.
Now _this commit_ is a style fix. Sorry....
Denis Vlasenko [Fri, 8 Sep 2006 17:22:45 +0000 (17:22 -0000)]
login: style fixes
Rob Landley [Fri, 8 Sep 2006 17:22:05 +0000 (17:22 -0000)]
Shrinkage/cleanup from Tito.
Rob Landley [Fri, 8 Sep 2006 17:21:19 +0000 (17:21 -0000)]
Fix warnings.
Rob Landley [Fri, 8 Sep 2006 16:59:08 +0000 (16:59 -0000)]
Second drop. More infrastructure in place, especially for parsing pipelines.
The minimal version got a couple hundred bytes bigger, partly because it's
broken into more functions but mostly because it now dynamically reallocates
and frees everything with no hard-coded limits. (I thought about making
that optional, but there's a limit to what I can debug and maintain. It
should still be reasonably NOMMU friendly, the allocations are small and
short lived, and shouldn't contribute noticeably to long-term memory
fragmentation.)
Rob Landley [Fri, 8 Sep 2006 00:41:48 +0000 (00:41 -0000)]
A quick cleanup pass of some low-hanging mess.
Rob Landley [Fri, 8 Sep 2006 00:01:02 +0000 (00:01 -0000)]
Bugfix for: echo '
123456789' | sed 's/./|&/5'
Denis Vlasenko [Thu, 7 Sep 2006 17:05:44 +0000 (17:05 -0000)]
Fix (hopefully) bug 976. Need more thorough audit.
Restore erroneously removed FEATURE_UDHCP_SYSLOG.
Denis Vlasenko [Thu, 7 Sep 2006 16:20:03 +0000 (16:20 -0000)]
getty, sulogin: convert to using bb_msg for syslog output
Denis Vlasenko [Thu, 7 Sep 2006 16:03:45 +0000 (16:03 -0000)]
fix if (ENABLE_FEATURE_SYSLOG & (...)) - should be &&
Denis Vlasenko [Thu, 7 Sep 2006 06:02:39 +0000 (06:02 -0000)]
Add CONFIG_FEATURE_SYSLOG which controls whether
bb_xx_msg will ever try to send output to syslog.
Add "select CONFIG_FEATURE_SYSLOG" to relevant applets.
This allows to omit syslog code if we do not have
any syslog-capable applets in the build.
Denis Vlasenko [Thu, 7 Sep 2006 05:43:38 +0000 (05:43 -0000)]
CONFIG_FEATURE_COMPRESS_USAGE was impossible to turn on
if !CONFIG_NITPICK
Denis Vlasenko [Thu, 7 Sep 2006 05:09:22 +0000 (05:09 -0000)]
adding files missed in prev updates (forgot about svn add)
Rob Landley [Wed, 6 Sep 2006 22:56:38 +0000 (22:56 -0000)]
Denis Vlasenko has started to put stuff on his BusyBox home page, so index it.
Denis Vlasenko [Wed, 6 Sep 2006 19:02:46 +0000 (19:02 -0000)]
removed a lot of trailing \n in bb_msg() calls. It is added
automatically by function itself.
Denis Vlasenko [Wed, 6 Sep 2006 18:36:50 +0000 (18:36 -0000)]
Implement optional syslog logging using ordinary
bb_xx_msg calls, and convert networking/* to it.
The rest of bbox will be converted gradually.
Bernhard Reutner-Fischer [Wed, 6 Sep 2006 15:28:32 +0000 (15:28 -0000)]
- strip 399424 off the bss by making decompress_uncompress buffers config buffers.
Compile tested (too lazy to look for a small .Z on the net).
$ size busybox.old busybox
text data bss dec hex filename
859555 10232 645732
1515519 171fff busybox.old
859683 10232 246308
1116223 11083f busybox
$ make bloatcheck
function old new delta
uncompress 1036 1160 +124
inbuf 2116 4 -2112
outbuf 4100 4 -4096
htab 131072 - -131072
codetab 262144 - -262144
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 1/2 up/down: 124/-399424) Total: -399300 bytes
Bernhard Reutner-Fischer [Wed, 6 Sep 2006 13:24:39 +0000 (13:24 -0000)]
- mdev and grep use xregcomp. Closes bug #1021
Rob Landley [Tue, 5 Sep 2006 14:00:21 +0000 (14:00 -0000)]
Vladimir Dronnikov (ybrnj80 at yandex dot ru) pointed out that my cleanup of
his code introduced a bug (an extra backslash in the CIFS mount string).
Rob Landley [Tue, 5 Sep 2006 13:48:21 +0000 (13:48 -0000)]
The bb_ prefixes were removed from xasprintf() and xopen() a month ago (in
svn 15767).
Denis Vlasenko [Tue, 5 Sep 2006 09:45:30 +0000 (09:45 -0000)]
run_shell.c: style fix
Denis Vlasenko [Tue, 5 Sep 2006 09:36:19 +0000 (09:36 -0000)]
xfunc: fix: && -> &. Also nuked two double semicolons...
Rob Landley [Tue, 5 Sep 2006 03:22:19 +0000 (03:22 -0000)]
Might as well commit this to have the history. It's not linked in to the
applet list yet (and won't be until it can replace lash, I'm not having five
shells in menuconfig at once), but you can build it with scripts/individual
and mostly this is checked in so I can bloatcheck future versions against it
easily....
This is about as small as a shell can get and still be a shell.
Rob Landley [Mon, 4 Sep 2006 19:43:26 +0000 (19:43 -0000)]
Thinko.
Rob Landley [Mon, 4 Sep 2006 18:59:39 +0000 (18:59 -0000)]
Patch from Natanael Copa to make start-stop-daemon just use readlink and
strcmp to check if a program is already running.
Denis Vlasenko [Sun, 3 Sep 2006 17:11:34 +0000 (17:11 -0000)]
sulogin: fix bug: -tNNN didn't work
Denis Vlasenko [Sun, 3 Sep 2006 16:33:58 +0000 (16:33 -0000)]
dpkg: fix buffer overflow (bug 983)
Denis Vlasenko [Sun, 3 Sep 2006 15:49:40 +0000 (15:49 -0000)]
uuencode: common implementation for wget and uuencode (closing bug 694)
Denis Vlasenko [Sun, 3 Sep 2006 14:23:29 +0000 (14:23 -0000)]
archival: added O_TRUNC so that when we overwrite files on unpack,
we truncate them. Also spotted & fixed hard to trigger bug
with extension handling.