aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS10
-rw-r--r--Changelog414
-rw-r--r--INSTALL6
-rw-r--r--Makefile4
-rw-r--r--README18
-rw-r--r--Rules.mak8
-rw-r--r--TODO2
-rw-r--r--applets/Makefile2
-rw-r--r--applets/Makefile.in2
-rw-r--r--applets/applets.c2
-rw-r--r--applets/busybox.c20
-rw-r--r--archival/Config.in22
-rw-r--r--archival/Makefile2
-rw-r--r--archival/Makefile.in2
-rw-r--r--archival/ar.c4
-rw-r--r--archival/cpio.c4
-rw-r--r--archival/dpkg.c84
-rw-r--r--archival/dpkg_deb.c4
-rw-r--r--archival/gunzip.c6
-rw-r--r--archival/gzip.c6
-rw-r--r--archival/libunarchive/Makefile2
-rw-r--r--archival/libunarchive/Makefile.in6
-rw-r--r--archival/libunarchive/data_extract_all.c4
-rw-r--r--archival/libunarchive/decompress_bunzip2.c2
-rw-r--r--archival/libunarchive/decompress_uncompress.c2
-rw-r--r--archival/libunarchive/decompress_unzip.c32
-rw-r--r--archival/libunarchive/filter_accept_list_reassign.c2
-rw-r--r--archival/libunarchive/get_header_ar.c2
-rw-r--r--archival/libunarchive/get_header_cpio.c6
-rw-r--r--archival/libunarchive/get_header_tar.c4
-rw-r--r--archival/libunarchive/uncompress.c2
-rw-r--r--archival/libunarchive/unzip.c32
-rw-r--r--archival/rpm.c4
-rw-r--r--archival/rpm2cpio.c2
-rw-r--r--archival/tar.c22
-rw-r--r--console-tools/Makefile2
-rw-r--r--console-tools/Makefile.in2
-rw-r--r--console-tools/chvt.c2
-rw-r--r--console-tools/clear.c2
-rw-r--r--console-tools/deallocvt.c4
-rw-r--r--console-tools/dumpkmap.c14
-rw-r--r--console-tools/loadkmap.c2
-rw-r--r--console-tools/openvt.c2
-rw-r--r--console-tools/reset.c2
-rw-r--r--console-tools/setkeycodes.c4
-rw-r--r--coreutils/Config.in6
-rw-r--r--coreutils/Makefile2
-rw-r--r--coreutils/Makefile.in2
-rw-r--r--coreutils/basename.c2
-rw-r--r--coreutils/cal.c6
-rw-r--r--coreutils/chgrp.c4
-rw-r--r--coreutils/chmod.c2
-rw-r--r--coreutils/chown.c6
-rw-r--r--coreutils/chroot.c2
-rw-r--r--coreutils/cut.c10
-rw-r--r--coreutils/date.c4
-rw-r--r--coreutils/df.c14
-rw-r--r--coreutils/dirname.c2
-rw-r--r--coreutils/dos2unix.c6
-rw-r--r--coreutils/du.c2
-rw-r--r--coreutils/echo.c8
-rw-r--r--coreutils/expr.c2
-rw-r--r--coreutils/false.c2
-rw-r--r--coreutils/id.c2
-rw-r--r--coreutils/install.c10
-rw-r--r--coreutils/libcoreutils/Makefile2
-rw-r--r--coreutils/libcoreutils/Makefile.in2
-rw-r--r--coreutils/ln.c6
-rw-r--r--coreutils/ls.c4
-rw-r--r--coreutils/md5_sha1_sum.c4
-rw-r--r--coreutils/mknod.c2
-rw-r--r--coreutils/mv.c8
-rw-r--r--coreutils/printf.c4
-rw-r--r--coreutils/rmdir.c2
-rw-r--r--coreutils/tail.c2
-rw-r--r--coreutils/tee.c2
-rw-r--r--coreutils/test.c4
-rw-r--r--coreutils/touch.c2
-rw-r--r--coreutils/tr.c14
-rw-r--r--coreutils/true.c2
-rw-r--r--coreutils/uudecode.c4
-rw-r--r--coreutils/wc.c36
-rw-r--r--coreutils/who.c34
-rw-r--r--debian/changelog20
-rw-r--r--debian/control4
-rw-r--r--debianutils/Config.in2
-rw-r--r--debianutils/Makefile2
-rw-r--r--debianutils/Makefile.in2
-rw-r--r--debianutils/mktemp.c2
-rw-r--r--debianutils/run_parts.c18
-rw-r--r--debianutils/which.c4
-rw-r--r--docs/busybox.net/about.html6
-rw-r--r--docs/busybox.net/busybox-growth.ps4
-rw-r--r--docs/busybox.net/copyright.txt2
-rw-r--r--docs/busybox.net/cvs_anon.html6
-rw-r--r--docs/busybox.net/cvs_howto.html10
-rw-r--r--docs/busybox.net/cvs_write.html10
-rw-r--r--docs/busybox.net/docs.html2
-rw-r--r--docs/busybox.net/download.html2
-rw-r--r--docs/busybox.net/footer.html2
-rw-r--r--docs/busybox.net/header.html6
-rw-r--r--docs/busybox.net/images/busybox.pngbin34015 -> 34014 bytes
-rw-r--r--docs/busybox.net/images/ltbutton2.pngbin6799 -> 6798 bytes
-rw-r--r--docs/busybox.net/license.html14
-rw-r--r--docs/busybox.net/lists.html8
-rw-r--r--docs/busybox.net/news.html6
-rw-r--r--docs/busybox.net/oldnews.html190
-rw-r--r--docs/busybox.net/screenshot.html2
-rw-r--r--docs/busybox.sgml78
-rw-r--r--docs/busybox_header.pod8
-rw-r--r--docs/contributing.txt6
-rw-r--r--docs/new-applet-HOWTO.txt12
-rw-r--r--docs/style-guide.txt12
-rw-r--r--editors/Config.in2
-rw-r--r--editors/Makefile2
-rw-r--r--editors/Makefile.in2
-rw-r--r--editors/awk.c14
-rw-r--r--editors/patch.c6
-rw-r--r--editors/sed.c6
-rw-r--r--editors/vi.c76
-rw-r--r--examples/bootfloppy/bootfloppy.txt12
-rw-r--r--examples/bootfloppy/etc/profile2
-rwxr-xr-xexamples/bootfloppy/mkrootfs.sh4
-rw-r--r--examples/bootfloppy/syslinux.cfg2
-rw-r--r--examples/busybox.spec2
-rwxr-xr-xexamples/depmod.pl18
-rw-r--r--examples/inittab4
-rw-r--r--examples/udhcp/udhcpd.conf2
-rw-r--r--examples/undeb10
-rw-r--r--examples/unrpm4
-rw-r--r--findutils/Config.in2
-rw-r--r--findutils/Makefile2
-rw-r--r--findutils/Makefile.in2
-rw-r--r--findutils/find.c8
-rw-r--r--findutils/grep.c8
-rw-r--r--findutils/xargs.c16
-rw-r--r--include/busybox.h4
-rw-r--r--include/libbb.h6
-rw-r--r--include/unarchive.h2
-rw-r--r--init/Makefile2
-rw-r--r--init/Makefile.in2
-rw-r--r--init/halt.c2
-rw-r--r--init/init.c32
-rw-r--r--init/init_shared.c2
-rw-r--r--init/poweroff.c2
-rw-r--r--init/reboot.c2
-rw-r--r--libbb/Makefile2
-rw-r--r--libbb/README4
-rw-r--r--libbb/bb_asprintf.c2
-rw-r--r--libbb/chomp.c4
-rw-r--r--libbb/concat_path_file.c2
-rw-r--r--libbb/copyfd.c2
-rw-r--r--libbb/correct_password.c6
-rw-r--r--libbb/device_open.c2
-rw-r--r--libbb/dump.c4
-rw-r--r--libbb/error_msg.c2
-rw-r--r--libbb/error_msg_and_die.c2
-rw-r--r--libbb/fgets_str.c2
-rw-r--r--libbb/find_mount_point.c2
-rw-r--r--libbb/find_pid_by_name.c8
-rw-r--r--libbb/find_root_device.c10
-rw-r--r--libbb/full_read.c2
-rw-r--r--libbb/full_write.c2
-rw-r--r--libbb/get_console.c2
-rw-r--r--libbb/get_line_from_file.c2
-rw-r--r--libbb/get_terminal_width_height.c4
-rw-r--r--libbb/hash_fd.c16
-rw-r--r--libbb/herror_msg.c2
-rw-r--r--libbb/herror_msg_and_die.c2
-rw-r--r--libbb/human_readable.c8
-rw-r--r--libbb/inode_hash.c4
-rw-r--r--libbb/interface.c24
-rw-r--r--libbb/isdirectory.c2
-rw-r--r--libbb/kernel_version.c2
-rw-r--r--libbb/loop.c2
-rw-r--r--libbb/messages.c2
-rw-r--r--libbb/module_syscalls.c2
-rw-r--r--libbb/mtab.c2
-rw-r--r--libbb/mtab_file.c6
-rw-r--r--libbb/my_getgrgid.c2
-rw-r--r--libbb/my_getgrnam.c2
-rw-r--r--libbb/my_getpwnam.c2
-rw-r--r--libbb/my_getpwnamegid.c2
-rw-r--r--libbb/my_getpwuid.c2
-rw-r--r--libbb/parse_mode.c2
-rw-r--r--libbb/parse_number.c2
-rw-r--r--libbb/perror_msg.c2
-rw-r--r--libbb/perror_msg_and_die.c2
-rw-r--r--libbb/print_file.c2
-rw-r--r--libbb/printf.c2
-rw-r--r--libbb/process_escape_sequence.c4
-rw-r--r--libbb/pw_encrypt.c2
-rw-r--r--libbb/read_package_field.c2
-rw-r--r--libbb/recursive_action.c8
-rw-r--r--libbb/run_parts.c4
-rw-r--r--libbb/run_shell.c8
-rw-r--r--libbb/safe_read.c2
-rw-r--r--libbb/safe_strncpy.c8
-rw-r--r--libbb/safe_write.c2
-rw-r--r--libbb/setup_environment.c4
-rw-r--r--libbb/syscalls.c2
-rw-r--r--libbb/syslog_msg_with_name.c2
-rw-r--r--libbb/trim.c2
-rw-r--r--libbb/u_signal_names.c2
-rw-r--r--libbb/vdprintf.c2
-rw-r--r--libbb/verror_msg.c2
-rw-r--r--libbb/vfork_daemon_rexec.c6
-rw-r--r--libbb/vherror_msg.c2
-rw-r--r--libbb/vperror_msg.c2
-rw-r--r--libbb/wfopen.c2
-rw-r--r--libbb/xconnect.c2
-rw-r--r--libbb/xfuncs.c10
-rw-r--r--libbb/xgetlarg.c2
-rw-r--r--libbb/xgetularg.c16
-rw-r--r--libbb/xreadlink.c8
-rw-r--r--libbb/xregcomp.c2
-rw-r--r--libpwdgrp/Makefile2
-rw-r--r--libpwdgrp/Makefile.in2
-rw-r--r--libpwdgrp/__getgrent.c4
-rw-r--r--libpwdgrp/__getpwent.c2
-rw-r--r--libpwdgrp/fgetgrent.c4
-rw-r--r--libpwdgrp/fgetpwent.c4
-rw-r--r--libpwdgrp/getgrgid.c4
-rw-r--r--libpwdgrp/getgrnam.c2
-rw-r--r--libpwdgrp/getpw.c4
-rw-r--r--libpwdgrp/getpwnam.c4
-rw-r--r--libpwdgrp/getpwuid.c2
-rw-r--r--libpwdgrp/grent.c4
-rw-r--r--libpwdgrp/initgroups.c4
-rw-r--r--libpwdgrp/putpwent.c4
-rw-r--r--libpwdgrp/pwent.c2
-rw-r--r--libpwdgrp/setgroups.c4
-rw-r--r--libpwdgrp/shadow.c10
-rw-r--r--loginutils/Makefile2
-rw-r--r--loginutils/Makefile.in2
-rw-r--r--loginutils/addgroup.c4
-rw-r--r--loginutils/adduser.c4
-rw-r--r--loginutils/getty.c14
-rw-r--r--loginutils/login.c48
-rw-r--r--loginutils/su.c12
-rw-r--r--miscutils/Config.in12
-rw-r--r--miscutils/Makefile2
-rw-r--r--miscutils/Makefile.in2
-rw-r--r--miscutils/adjtimex.c4
-rw-r--r--miscutils/dc.c6
-rw-r--r--miscutils/hdparm.c6
-rw-r--r--miscutils/last.c6
-rw-r--r--miscutils/makedevs.c4
-rw-r--r--miscutils/mt.c2
-rw-r--r--miscutils/rx.c14
-rw-r--r--miscutils/strings.c2
-rw-r--r--miscutils/time.c2
-rw-r--r--miscutils/watchdog.c2
-rw-r--r--modutils/Config.in10
-rw-r--r--modutils/Makefile2
-rw-r--r--modutils/Makefile.in2
-rw-r--r--modutils/insmod.c67
-rw-r--r--modutils/lsmod.c2
-rw-r--r--modutils/rmmod.c6
-rw-r--r--networking/Config.in10
-rw-r--r--networking/Makefile2
-rw-r--r--networking/Makefile.in2
-rw-r--r--networking/ftpgetput.c14
-rw-r--r--networking/httpd.c28
-rw-r--r--networking/ifconfig.c6
-rw-r--r--networking/ifupdown.c28
-rw-r--r--networking/libiproute/Makefile2
-rw-r--r--networking/libiproute/Makefile.in2
-rw-r--r--networking/libiproute/ip_parse_common_args.c2
-rw-r--r--networking/libiproute/ipaddress.c8
-rw-r--r--networking/libiproute/iplink.c30
-rw-r--r--networking/libiproute/iproute.c8
-rw-r--r--networking/libiproute/iptunnel.c6
-rw-r--r--networking/libiproute/libnetlink.c4
-rw-r--r--networking/libiproute/linux/pkt_sched.h20
-rw-r--r--networking/libiproute/ll_proto.c72
-rw-r--r--networking/libiproute/utils.h2
-rw-r--r--networking/nc.c6
-rw-r--r--networking/netstat.c16
-rw-r--r--networking/nslookup.c4
-rw-r--r--networking/ping.c10
-rw-r--r--networking/ping6.c14
-rw-r--r--networking/route.c8
-rw-r--r--networking/telnet.c54
-rw-r--r--networking/telnetd.c6
-rw-r--r--networking/tftp.c36
-rw-r--r--networking/traceroute.c2
-rw-r--r--networking/udhcp/AUTHORS1
-rw-r--r--networking/udhcp/ChangeLog2
-rw-r--r--networking/udhcp/Makefile2
-rw-r--r--networking/udhcp/Makefile.in2
-rw-r--r--networking/udhcp/README16
-rw-r--r--networking/udhcp/README.udhcpc10
-rw-r--r--networking/udhcp/README.udhcpd8
-rw-r--r--networking/udhcp/arpping.c16
-rw-r--r--networking/udhcp/arpping.h2
-rw-r--r--networking/udhcp/clientpacket.c32
-rw-r--r--networking/udhcp/common.c2
-rw-r--r--networking/udhcp/common.h2
-rw-r--r--networking/udhcp/dhcpc.c48
-rw-r--r--networking/udhcp/dhcpd.c34
-rw-r--r--networking/udhcp/dhcpd.h4
-rw-r--r--networking/udhcp/dumpleases.c10
-rw-r--r--networking/udhcp/files.c44
-rw-r--r--networking/udhcp/frontend.c4
-rw-r--r--networking/udhcp/leases.c30
-rw-r--r--networking/udhcp/options.c30
-rw-r--r--networking/udhcp/packet.c18
-rw-r--r--networking/udhcp/packet.h2
-rw-r--r--networking/udhcp/script.c10
-rw-r--r--networking/udhcp/serverpacket.c48
-rw-r--r--networking/udhcp/socket.c8
-rw-r--r--networking/vconfig.c4
-rw-r--r--networking/wget.c50
-rw-r--r--patches/eject.diff10
-rw-r--r--patches/tftp_timeout_multicast.diff192
-rw-r--r--patches/udhcp_additional_items.diff16
-rw-r--r--patches/udhcp_config_paths.diff108
-rw-r--r--patches/udhcpd_foreground.diff8
-rw-r--r--procps/Makefile2
-rw-r--r--procps/Makefile.in2
-rw-r--r--procps/free.c8
-rw-r--r--procps/kill.c2
-rw-r--r--procps/pidof.c2
-rw-r--r--procps/ps.c2
-rw-r--r--procps/renice.c8
-rw-r--r--procps/sysctl.c10
-rw-r--r--procps/top.c20
-rw-r--r--procps/uptime.c12
-rw-r--r--scripts/config/Kconfig-language.txt2
-rw-r--r--scripts/config/Makefile4
-rw-r--r--scripts/config/checklist.c10
-rw-r--r--scripts/config/dialog.h4
-rw-r--r--scripts/config/lex.zconf.c_shipped84
-rw-r--r--scripts/config/mconf.c12
-rw-r--r--scripts/config/menu.c2
-rw-r--r--scripts/config/menubox.c6
-rw-r--r--scripts/config/util.c6
-rw-r--r--scripts/config/zconf.tab.c_shipped32
-rw-r--r--scripts/mkdep.c2
-rw-r--r--scripts/split-include.c2
-rw-r--r--shell/Config.in2
-rw-r--r--shell/Makefile2
-rw-r--r--shell/Makefile.in2
-rw-r--r--shell/ash.c2
-rw-r--r--shell/hush.c112
-rw-r--r--shell/lash.c6
-rw-r--r--shell/msh.c54
-rw-r--r--sysdeps/linux/Config.in20
-rw-r--r--sysklogd/Config.in6
-rw-r--r--sysklogd/Makefile2
-rw-r--r--sysklogd/Makefile.in2
-rw-r--r--sysklogd/klogd.c4
-rw-r--r--sysklogd/logger.c14
-rw-r--r--sysklogd/logread.c28
-rw-r--r--sysklogd/syslogd.c2
-rwxr-xr-xtests/multibuild.pl2
-rwxr-xr-xtests/tester.sh6
-rw-r--r--util-linux/Config.in10
-rw-r--r--util-linux/Makefile2
-rw-r--r--util-linux/Makefile.in2
-rw-r--r--util-linux/dmesg.c4
-rw-r--r--util-linux/fbset.c18
-rw-r--r--util-linux/fdisk.c4
-rw-r--r--util-linux/freeramdisk.c2
-rw-r--r--util-linux/fsck_minix.c10
-rw-r--r--util-linux/hwclock.c38
-rw-r--r--util-linux/mkfs_minix.c8
-rw-r--r--util-linux/more.c8
-rw-r--r--util-linux/mount.c12
-rw-r--r--util-linux/nfsmount.c12
-rw-r--r--util-linux/pivot_root.c2
-rw-r--r--util-linux/swaponoff.c3
-rw-r--r--util-linux/umount.c6
374 files changed, 2048 insertions, 2051 deletions
diff --git a/AUTHORS b/AUTHORS
index a6f81abcf..c73b47abf 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -23,7 +23,7 @@ Jeff Angielski <jeff@theptrgroup.com>
23 23
24Edward Betts <edward@debian.org> 24Edward Betts <edward@debian.org>
25 expr, hostid, logname, whoami 25 expr, hostid, logname, whoami
26 26
27John Beppu <beppu@codepoet.org> 27John Beppu <beppu@codepoet.org>
28 du, nslookup, sort 28 du, nslookup, sort
29 29
@@ -33,8 +33,8 @@ Brian Candler <B.Candler@pobox.com>
33Randolph Chung <tausq@debian.org> 33Randolph Chung <tausq@debian.org>
34 fbset, ping, hostname 34 fbset, ping, hostname
35 35
36Dave Cinege <dcinege@psychosis.com> 36Dave Cinege <dcinege@psychosis.com>
37 more(v2), makedevs, dutmp, modularization, auto links file, 37 more(v2), makedevs, dutmp, modularization, auto links file,
38 various fixes, Linux Router Project maintenance 38 various fixes, Linux Router Project maintenance
39 39
40Jordan Crouse <jordan@cosmicpenguin.net> 40Jordan Crouse <jordan@cosmicpenguin.net>
@@ -66,7 +66,7 @@ Matt Kraai <kraai@alumni.cmu.edu>
66Stephan Linz <linz@li-pro.net> 66Stephan Linz <linz@li-pro.net>
67 ipcalc, Red Hat equivalence 67 ipcalc, Red Hat equivalence
68 68
69John Lombardo <john@deltanet.com> 69John Lombardo <john@deltanet.com>
70 tr 70 tr
71 71
72Glenn McGrath <bug1@optushome.com.au> 72Glenn McGrath <bug1@optushome.com.au>
@@ -89,7 +89,7 @@ Vladimir Oleynik <dzo@simtreas.ru>
89 and irreconcilable critic of everything not perfect. 89 and irreconcilable critic of everything not perfect.
90 90
91Bruce Perens <bruce@pixar.com> 91Bruce Perens <bruce@pixar.com>
92 Original author of BusyBox in 1995, 1996. Some of his code can 92 Original author of BusyBox in 1995, 1996. Some of his code can
93 still be found hiding here and there... 93 still be found hiding here and there...
94 94
95Tim Riker <Tim@Rikers.org> 95Tim Riker <Tim@Rikers.org>
diff --git a/Changelog b/Changelog
index ca1dcf301..4d22f5bef 100644
--- a/Changelog
+++ b/Changelog
@@ -1,171 +1,171 @@
1--------------------- 1---------------------
2PatchSet 3926 2PatchSet 3926
3Date: 2004/02/09 10:01:01 3Date: 2004/02/09 10:01:01
4Author: andersen 4Author: andersen
5Branch: HEAD 5Branch: HEAD
6Tag: (none) 6Tag: (none)
7Log: 7Log:
8Buffalo appears to have resolved their GPL problems 8Buffalo appears to have resolved their GPL problems
9 9
10Members: 10Members:
11 docs/busybox.net/products.html:1.5->1.6 11 docs/busybox.net/products.html:1.5->1.6
12 docs/busybox.net/shame.html:1.7->1.8 12 docs/busybox.net/shame.html:1.7->1.8
13 13
14--------------------- 14---------------------
15PatchSet 3927 15PatchSet 3927
16Date: 2004/02/09 10:57:04 16Date: 2004/02/09 10:57:04
17Author: andersen 17Author: andersen
18Branch: HEAD 18Branch: HEAD
19Tag: (none) 19Tag: (none)
20Log: 20Log:
21Update URL 21Update URL
22 22
23Members: 23Members:
24 docs/busybox.net/products.html:1.6->1.7 24 docs/busybox.net/products.html:1.6->1.7
25 25
26--------------------- 26---------------------
27PatchSet 3928 27PatchSet 3928
28Date: 2004/02/10 01:07:45 28Date: 2004/02/10 01:07:45
29Author: andersen 29Author: andersen
30Branch: HEAD 30Branch: HEAD
31Tag: (none) 31Tag: (none)
32Log: 32Log:
33Support disabling pipe and redirect support 33Support disabling pipe and redirect support
34 34
35Members: 35Members:
36 shell/lash.c:1.151->1.152 36 shell/lash.c:1.151->1.152
37 37
38--------------------- 38---------------------
39PatchSet 3929 39PatchSet 3929
40Date: 2004/02/10 01:28:36 40Date: 2004/02/10 01:28:36
41Author: andersen 41Author: andersen
42Branch: HEAD 42Branch: HEAD
43Tag: (none) 43Tag: (none)
44Log: 44Log:
45Initial effort at disabling job control as well 45Initial effort at disabling job control as well
46 46
47Members: 47Members:
48 shell/lash.c:1.152->1.153 48 shell/lash.c:1.152->1.153
49 49
50--------------------- 50---------------------
51PatchSet 3930 51PatchSet 3930
52Date: 2004/02/10 01:30:21 52Date: 2004/02/10 01:30:21
53Author: andersen 53Author: andersen
54Branch: HEAD 54Branch: HEAD
55Tag: (none) 55Tag: (none)
56Log: 56Log:
57oops. Leave the default feature set enbled for now... 57oops. Leave the default feature set enbled for now...
58 58
59Members: 59Members:
60 shell/lash.c:1.153->1.154 60 shell/lash.c:1.153->1.154
61 61
62--------------------- 62---------------------
63PatchSet 3931 63PatchSet 3931
64Date: 2004/02/13 08:09:43 64Date: 2004/02/13 08:09:43
65Author: andersen 65Author: andersen
66Branch: HEAD 66Branch: HEAD
67Tag: (none) 67Tag: (none)
68Log: 68Log:
69Accomodate the fact that newer libc versions may in fact not 69Accomodate the fact that newer libc versions may in fact not
70contain query_module and friends and more 70contain query_module and friends and more
71 71
72Members: 72Members:
73 libbb/module_syscalls.c:1.13->1.14 73 libbb/module_syscalls.c:1.13->1.14
74 74
75--------------------- 75---------------------
76PatchSet 3932 76PatchSet 3932
77Date: 2004/02/14 21:33:39 77Date: 2004/02/14 21:33:39
78Author: andersen 78Author: andersen
79Branch: HEAD 79Branch: HEAD
80Tag: (none) 80Tag: (none)
81Log: 81Log:
82Avoid naming conflict with symbol in newer glibc headers 82Avoid naming conflict with symbol in newer glibc headers
83 83
84Members: 84Members:
85 miscutils/hdparm.c:1.9->1.10 85 miscutils/hdparm.c:1.9->1.10
86 86
87--------------------- 87---------------------
88PatchSet 3933 88PatchSet 3933
89Date: 2004/02/17 07:51:31 89Date: 2004/02/17 07:51:31
90Author: bug1 90Author: bug1
91Branch: HEAD 91Branch: HEAD
92Tag: (none) 92Tag: (none)
93Log: 93Log:
94define option names to be clearer, simplify nested if statements, remove 94define option names to be clearer, simplify nested if statements, remove
95un-needed if statement, minor indenting change 95un-needed if statement, minor indenting change
96 96
97Members: 97Members:
98 coreutils/date.c:1.41->1.42 98 coreutils/date.c:1.41->1.42
99 99
100--------------------- 100---------------------
101PatchSet 3934 101PatchSet 3934
102Date: 2004/02/17 07:58:04 102Date: 2004/02/17 07:58:04
103Author: bug1 103Author: bug1
104Branch: HEAD 104Branch: HEAD
105Tag: (none) 105Tag: (none)
106Log: 106Log:
107Woops, im getting ahead of myself, we dont have the -r (refernece) 107Woops, im getting ahead of myself, we dont have the -r (refernece)
108option yet 108option yet
109 109
110Members: 110Members:
111 coreutils/date.c:1.42->1.43 111 coreutils/date.c:1.42->1.43
112 112
113--------------------- 113---------------------
114PatchSet 3935 114PatchSet 3935
115Date: 2004/02/17 10:16:21 115Date: 2004/02/17 10:16:21
116Author: mjn3 116Author: mjn3
117Branch: HEAD 117Branch: HEAD
118Tag: (none) 118Tag: (none)
119Log: 119Log:
120Patch from Florian Schirmer <jolt@tuxbox.org>. When I rewrote the parser, 120Patch from Florian Schirmer <jolt@tuxbox.org>. When I rewrote the parser,
121I overlooked the case of someone wanting to use a valid but empty suid 121I overlooked the case of someone wanting to use a valid but empty suid
122config file. 122config file.
123 123
124Members: 124Members:
125 applets/applets.c:1.21->1.22 125 applets/applets.c:1.21->1.22
126 126
127--------------------- 127---------------------
128PatchSet 3936 128PatchSet 3936
129Date: 2004/02/17 11:55:06 129Date: 2004/02/17 11:55:06
130Author: bug1 130Author: bug1
131Branch: HEAD 131Branch: HEAD
132Tag: (none) 132Tag: (none)
133Log: 133Log:
134Dont strip trailing '/' until _after_ i test to set if its there ! 134Dont strip trailing '/' until _after_ i test to set if its there !
135 135
136Members: 136Members:
137 archival/libunarchive/get_header_tar.c:1.30->1.31 137 archival/libunarchive/get_header_tar.c:1.30->1.31
138 138
139--------------------- 139---------------------
140PatchSet 3937 140PatchSet 3937
141Date: 2004/02/17 12:04:13 141Date: 2004/02/17 12:04:13
142Author: bug1 142Author: bug1
143Branch: HEAD 143Branch: HEAD
144Tag: (none) 144Tag: (none)
145Log: 145Log:
146Remove debugging 146Remove debugging
147 147
148Members: 148Members:
149 archival/libunarchive/get_header_tar.c:1.31->1.32 149 archival/libunarchive/get_header_tar.c:1.31->1.32
150 150
151--------------------- 151---------------------
152PatchSet 3938 152PatchSet 3938
153Date: 2004/02/17 12:22:21 153Date: 2004/02/17 12:22:21
154Author: bug1 154Author: bug1
155Branch: HEAD 155Branch: HEAD
156Tag: (none) 156Tag: (none)
157Log: 157Log:
158Add the -r option, patch from Rob with some help from myself. 158Add the -r option, patch from Rob with some help from myself.
159 159
160Members: 160Members:
161 coreutils/date.c:1.43->1.44 161 coreutils/date.c:1.43->1.44
162 162
163--------------------- 163---------------------
164PatchSet 3939 164PatchSet 3939
165Date: 2004/02/17 20:04:34 165Date: 2004/02/17 20:04:34
166Author: andersen 166Author: andersen
167Branch: HEAD 167Branch: HEAD
168Tag: (none) 168Tag: (none)
169Log: 169Log:
170Mark Lord writes: 170Mark Lord writes:
171 171
@@ -179,99 +179,99 @@ Cheers
179Mark Lord 179Mark Lord
180Real-Time Remedies Inc. 180Real-Time Remedies Inc.
181 181
182Members: 182Members:
183 networking/inetd.c:1.14->1.15 183 networking/inetd.c:1.14->1.15
184 184
185--------------------- 185---------------------
186PatchSet 3940 186PatchSet 3940
187Date: 2004/02/17 20:08:11 187Date: 2004/02/17 20:08:11
188Author: andersen 188Author: andersen
189Branch: HEAD 189Branch: HEAD
190Tag: (none) 190Tag: (none)
191Log: 191Log:
192Remove the unused CONFIG_FEATURE_HTTPD_SET_CGI_VARS_TO_ENV option. 192Remove the unused CONFIG_FEATURE_HTTPD_SET_CGI_VARS_TO_ENV option.
193 193
194Members: 194Members:
195 networking/Config.in:1.25->1.26 195 networking/Config.in:1.25->1.26
196 196
197--------------------- 197---------------------
198PatchSet 3941 198PatchSet 3941
199Date: 2004/02/18 09:40:41 199Date: 2004/02/18 09:40:41
200Author: mjn3 200Author: mjn3
201Branch: HEAD 201Branch: HEAD
202Tag: (none) 202Tag: (none)
203Log: 203Log:
204Fix vstype[] to match VS* defines. Patch from OpenWrt by mbm. 204Fix vstype[] to match VS* defines. Patch from OpenWrt by mbm.
205 205
206Members: 206Members:
207 shell/ash.c:1.89->1.90 207 shell/ash.c:1.89->1.90
208 208
209--------------------- 209---------------------
210PatchSet 3942 210PatchSet 3942
211Date: 2004/02/18 09:54:15 211Date: 2004/02/18 09:54:15
212Author: landley 212Author: landley
213Branch: HEAD 213Branch: HEAD
214Tag: (none) 214Tag: (none)
215Log: 215Log:
216Add -i option to sed, to edit files in-place. 216Add -i option to sed, to edit files in-place.
217 217
218Members: 218Members:
219 editors/sed.c:1.159->1.160 219 editors/sed.c:1.159->1.160
220 220
221--------------------- 221---------------------
222PatchSet 3943 222PatchSet 3943
223Date: 2004/02/18 10:14:17 223Date: 2004/02/18 10:14:17
224Author: mjn3 224Author: mjn3
225Branch: HEAD 225Branch: HEAD
226Tag: (none) 226Tag: (none)
227Log: 227Log:
228Patch from OpenWrt. 228Patch from OpenWrt.
229 229
230Members: 230Members:
231 modutils/insmod.c:1.111->1.112 231 modutils/insmod.c:1.111->1.112
232 232
233--------------------- 233---------------------
234PatchSet 3944 234PatchSet 3944
235Date: 2004/02/18 12:58:00 235Date: 2004/02/18 12:58:00
236Author: bug1 236Author: bug1
237Branch: HEAD 237Branch: HEAD
238Tag: (none) 238Tag: (none)
239Log: 239Log:
240remove debugging 240remove debugging
241 241
242Members: 242Members:
243 networking/inetd.c:1.15->1.16 243 networking/inetd.c:1.15->1.16
244 244
245--------------------- 245---------------------
246PatchSet 3945 246PatchSet 3945
247Date: 2004/02/18 13:12:53 247Date: 2004/02/18 13:12:53
248Author: bug1 248Author: bug1
249Branch: HEAD 249Branch: HEAD
250Tag: (none) 250Tag: (none)
251Log: 251Log:
252Formatting 252Formatting
253 253
254Members: 254Members:
255 networking/inetd.c:1.16->1.17 255 networking/inetd.c:1.16->1.17
256 256
257--------------------- 257---------------------
258PatchSet 3946 258PatchSet 3946
259Date: 2004/02/18 13:19:58 259Date: 2004/02/18 13:19:58
260Author: bug1 260Author: bug1
261Branch: HEAD 261Branch: HEAD
262Tag: (none) 262Tag: (none)
263Log: 263Log:
264Dont use same variable and struct name 264Dont use same variable and struct name
265 265
266Members: 266Members:
267 networking/inetd.c:1.17->1.18 267 networking/inetd.c:1.17->1.18
268 268
269--------------------- 269---------------------
270PatchSet 3947 270PatchSet 3947
271Date: 2004/02/19 00:44:08 271Date: 2004/02/19 00:44:08
272Author: andersen 272Author: andersen
273Branch: HEAD 273Branch: HEAD
274Tag: (none) 274Tag: (none)
275Log: 275Log:
276Chris Larson (kergoth) writes: 276Chris Larson (kergoth) writes:
277 277
@@ -286,15 +286,15 @@ Will never return until we run out of open files or similar.
286Coreutils cp on the other hand will error with "cannot copy a directory, 286Coreutils cp on the other hand will error with "cannot copy a directory,
287`out', into itself, `out'". Patch attached. 287`out', into itself, `out'". Patch attached.
288 288
289Members: 289Members:
290 libbb/copy_file.c:1.28->1.29 290 libbb/copy_file.c:1.28->1.29
291 291
292--------------------- 292---------------------
293PatchSet 3948 293PatchSet 3948
294Date: 2004/02/19 01:52:29 294Date: 2004/02/19 01:52:29
295Author: andersen 295Author: andersen
296Branch: HEAD 296Branch: HEAD
297Tag: (none) 297Tag: (none)
298Log: 298Log:
299Chris Larson (kergoth) writes: 299Chris Larson (kergoth) writes:
300 300
@@ -307,241 +307,241 @@ cp -a cpa cpa/cpb/cpc
307Attached what appears to be a more sane fix. Apply on top of previous. 307Attached what appears to be a more sane fix. Apply on top of previous.
308Please confirm sanity. 308Please confirm sanity.
309 309
310Members: 310Members:
311 libbb/copy_file.c:1.29->1.30 311 libbb/copy_file.c:1.29->1.30
312 312
313--------------------- 313---------------------
314PatchSet 3949 314PatchSet 3949
315Date: 2004/02/19 08:48:30 315Date: 2004/02/19 08:48:30
316Author: bug1 316Author: bug1
317Branch: HEAD 317Branch: HEAD
318Tag: (none) 318Tag: (none)
319Log: 319Log:
320Add extra comments, freakout if a pax archive is encoutered. 320Add extra comments, freakout if a pax archive is encoutered.
321 321
322Members: 322Members:
323 archival/libunarchive/get_header_tar.c:1.32->1.33 323 archival/libunarchive/get_header_tar.c:1.32->1.33
324 324
325--------------------- 325---------------------
326PatchSet 3950 326PatchSet 3950
327Date: 2004/02/20 02:25:18 327Date: 2004/02/20 02:25:18
328Author: bug1 328Author: bug1
329Branch: HEAD 329Branch: HEAD
330Tag: (none) 330Tag: (none)
331Log: 331Log:
332A strict interpretation of the ustar format requires the type flag to be 332A strict interpretation of the ustar format requires the type flag to be
333interpreted, we cannot depend on the file type being set in the mode 333interpreted, we cannot depend on the file type being set in the mode
334field. 334field.
335 335
336Members: 336Members:
337 archival/libunarchive/get_header_tar.c:1.33->1.34 337 archival/libunarchive/get_header_tar.c:1.33->1.34
338 338
339--------------------- 339---------------------
340PatchSet 3951 340PatchSet 3951
341Date: 2004/02/20 02:34:42 341Date: 2004/02/20 02:34:42
342Author: bug1 342Author: bug1
343Branch: HEAD 343Branch: HEAD
344Tag: (none) 344Tag: (none)
345Log: 345Log:
346Fix up hard links 346Fix up hard links
347 347
348Members: 348Members:
349 archival/libunarchive/get_header_tar.c:1.34->1.35 349 archival/libunarchive/get_header_tar.c:1.34->1.35
350 350
351--------------------- 351---------------------
352PatchSet 3952 352PatchSet 3952
353Date: 2004/02/20 09:55:37 353Date: 2004/02/20 09:55:37
354Author: andersen 354Author: andersen
355Branch: HEAD 355Branch: HEAD
356Tag: (none) 356Tag: (none)
357Log: 357Log:
358Document missing cp options 358Document missing cp options
359 359
360Members: 360Members:
361 include/usage.h:1.187->1.188 361 include/usage.h:1.187->1.188
362 362
363--------------------- 363---------------------
364PatchSet 3953 364PatchSet 3953
365Date: 2004/02/21 07:49:54 365Date: 2004/02/21 07:49:54
366Author: bug1 366Author: bug1
367Branch: HEAD 367Branch: HEAD
368Tag: (none) 368Tag: (none)
369Log: 369Log:
370Use return instead of exit, use == instead of & ==, left justify labels, 370Use return instead of exit, use == instead of & ==, left justify labels,
371adjustment of whitespace. 371adjustment of whitespace.
372 372
373Members: 373Members:
374 coreutils/mv.c:1.19->1.20 374 coreutils/mv.c:1.19->1.20
375 375
376--------------------- 376---------------------
377PatchSet 3954 377PatchSet 3954
378Date: 2004/02/21 09:20:56 378Date: 2004/02/21 09:20:56
379Author: bug1 379Author: bug1
380Branch: HEAD 380Branch: HEAD
381Tag: (none) 381Tag: (none)
382Log: 382Log:
383Sometimes i get carried away with the use of function pointers, im sure 383Sometimes i get carried away with the use of function pointers, im sure
384it seemed like a good idea at the time. 384it seemed like a good idea at the time.
385 385
386Members: 386Members:
387 archival/libunarchive/seek_by_char.c:1.3->1.4 387 archival/libunarchive/seek_by_char.c:1.3->1.4
388 include/libbb.h:1.126->1.127 388 include/libbb.h:1.126->1.127
389 libbb/copyfd.c:1.9->1.10 389 libbb/copyfd.c:1.9->1.10
390 390
391--------------------- 391---------------------
392PatchSet 3955 392PatchSet 3955
393Date: 2004/02/22 00:27:34 393Date: 2004/02/22 00:27:34
394Author: bug1 394Author: bug1
395Branch: HEAD 395Branch: HEAD
396Tag: (none) 396Tag: (none)
397Log: 397Log:
398No need to check proxy env variable twice, ignore proxy env variable if 398No need to check proxy env variable twice, ignore proxy env variable if
399its set to 0 399its set to 0
400 400
401Members: 401Members:
402 networking/wget.c:1.68->1.69 402 networking/wget.c:1.68->1.69
403 403
404--------------------- 404---------------------
405PatchSet 3956 405PatchSet 3956
406Date: 2004/02/22 02:58:57 406Date: 2004/02/22 02:58:57
407Author: bug1 407Author: bug1
408Branch: HEAD 408Branch: HEAD
409Tag: (none) 409Tag: (none)
410Log: 410Log:
411Return 1 upon failure 411Return 1 upon failure
412 412
413Members: 413Members:
414 coreutils/md5_sha1_sum.c:1.4->1.5 414 coreutils/md5_sha1_sum.c:1.4->1.5
415 415
416--------------------- 416---------------------
417PatchSet 3957 417PatchSet 3957
418Date: 2004/02/22 03:33:53 418Date: 2004/02/22 03:33:53
419Author: bug1 419Author: bug1
420Branch: HEAD 420Branch: HEAD
421Tag: (none) 421Tag: (none)
422Log: 422Log:
423Ptch by Hideki IWAMOTO, fix a bug preventing tftp from getting or 423Ptch by Hideki IWAMOTO, fix a bug preventing tftp from getting or
424putting more than 0xffff blocks. 424putting more than 0xffff blocks.
425 425
426Members: 426Members:
427 networking/tftp.c:1.21->1.22 427 networking/tftp.c:1.21->1.22
428 428
429--------------------- 429---------------------
430PatchSet 3958 430PatchSet 3958
431Date: 2004/02/22 04:12:58 431Date: 2004/02/22 04:12:58
432Author: bug1 432Author: bug1
433Branch: HEAD 433Branch: HEAD
434Tag: (none) 434Tag: (none)
435Log: 435Log:
436Update usage for ftpget and ftpput 436Update usage for ftpget and ftpput
437 437
438Members: 438Members:
439 include/usage.h:1.188->1.189 439 include/usage.h:1.188->1.189
440 440
441--------------------- 441---------------------
442PatchSet 3959 442PatchSet 3959
443Date: 2004/02/22 04:17:26 443Date: 2004/02/22 04:17:26
444Author: bug1 444Author: bug1
445Branch: HEAD 445Branch: HEAD
446Tag: (none) 446Tag: (none)
447Log: 447Log:
448Thomas Geulig, remove duplicate header 448Thomas Geulig, remove duplicate header
449 449
450Members: 450Members:
451 init/init_shared.c:1.3->1.4 451 init/init_shared.c:1.3->1.4
452 452
453--------------------- 453---------------------
454PatchSet 3960 454PatchSet 3960
455Date: 2004/02/22 04:44:21 455Date: 2004/02/22 04:44:21
456Author: bug1 456Author: bug1
457Branch: HEAD 457Branch: HEAD
458Tag: (none) 458Tag: (none)
459Log: 459Log:
460Fixup braces (patch from Thomas Geulig), run through indent and manually 460Fixup braces (patch from Thomas Geulig), run through indent and manually
461adjust. 461adjust.
462 462
463Members: 463Members:
464 miscutils/crond.c:1.12->1.13 464 miscutils/crond.c:1.12->1.13
465 465
466--------------------- 466---------------------
467PatchSet 3961 467PatchSet 3961
468Date: 2004/02/22 04:58:36 468Date: 2004/02/22 04:58:36
469Author: bug1 469Author: bug1
470Branch: HEAD 470Branch: HEAD
471Tag: (none) 471Tag: (none)
472Log: 472Log:
473remove duplicate header declarations 473remove duplicate header declarations
474 474
475Members: 475Members:
476 networking/inetd.c:1.18->1.19 476 networking/inetd.c:1.18->1.19
477 477
478--------------------- 478---------------------
479PatchSet 3962 479PatchSet 3962
480Date: 2004/02/22 07:20:25 480Date: 2004/02/22 07:20:25
481Author: bug1 481Author: bug1
482Branch: HEAD 482Branch: HEAD
483Tag: (none) 483Tag: (none)
484Log: 484Log:
485Patch from Hideki IWAMOTO, output debugging messages to stderr 485Patch from Hideki IWAMOTO, output debugging messages to stderr
486 486
487Members: 487Members:
488 networking/tftp.c:1.22->1.23 488 networking/tftp.c:1.22->1.23
489 489
490--------------------- 490---------------------
491PatchSet 3963 491PatchSet 3963
492Date: 2004/02/22 07:38:36 492Date: 2004/02/22 07:38:36
493Author: bug1 493Author: bug1
494Branch: HEAD 494Branch: HEAD
495Tag: (none) 495Tag: (none)
496Log: 496Log:
497Patch from Florian Schirmer. compile fix for debug builds 497Patch from Florian Schirmer. compile fix for debug builds
498 498
499Members: 499Members:
500 miscutils/devfsd.c:1.7->1.8 500 miscutils/devfsd.c:1.7->1.8
501 501
502--------------------- 502---------------------
503PatchSet 3964 503PatchSet 3964
504Date: 2004/02/22 08:33:37 504Date: 2004/02/22 08:33:37
505Author: bug1 505Author: bug1
506Branch: HEAD 506Branch: HEAD
507Tag: (none) 507Tag: (none)
508Log: 508Log:
509Use /var/lib/hwclock for adjtime, its really a state file rather than a 509Use /var/lib/hwclock for adjtime, its really a state file rather than a
510config file, so it should be in /etc, FHS mentions it also. 510config file, so it should be in /etc, FHS mentions it also.
511 511
512Members: 512Members:
513 util-linux/hwclock.c:1.6->1.7 513 util-linux/hwclock.c:1.6->1.7
514 514
515--------------------- 515---------------------
516PatchSet 3965 516PatchSet 3965
517Date: 2004/02/22 09:11:33 517Date: 2004/02/22 09:11:33
518Author: bug1 518Author: bug1
519Branch: HEAD 519Branch: HEAD
520Tag: (none) 520Tag: (none)
521Log: 521Log:
522Use bb_getopt_ulflags, marginal saving, better argument checking. 522Use bb_getopt_ulflags, marginal saving, better argument checking.
523 523
524Members: 524Members:
525 util-linux/hwclock.c:1.7->1.8 525 util-linux/hwclock.c:1.7->1.8
526 526
527--------------------- 527---------------------
528PatchSet 3966 528PatchSet 3966
529Date: 2004/02/22 09:45:57 529Date: 2004/02/22 09:45:57
530Author: bug1 530Author: bug1
531Branch: HEAD 531Branch: HEAD
532Tag: (none) 532Tag: (none)
533Log: 533Log:
534Patch from James Zhu, telnetd window resizing support. 534Patch from James Zhu, telnetd window resizing support.
535 535
536Members: 536Members:
537 networking/telnetd.c:1.9->1.10 537 networking/telnetd.c:1.9->1.10
538 538
539--------------------- 539---------------------
540PatchSet 3967 540PatchSet 3967
541Date: 2004/02/22 11:13:28 541Date: 2004/02/22 11:13:28
542Author: bug1 542Author: bug1
543Branch: HEAD 543Branch: HEAD
544Tag: (none) 544Tag: (none)
545Log: 545Log:
546Vodz. last_patch_128 546Vodz. last_patch_128
547- declare applet_using as static from applets.c 547- declare applet_using as static from applets.c
@@ -549,82 +549,82 @@ Vodz. last_patch_128
549 previous version cleared history after Ctrl-C 549 previous version cleared history after Ctrl-C
550- small spelling correction (by Friedrich Lobenstock) 550- small spelling correction (by Friedrich Lobenstock)
551 551
552Members: 552Members:
553 applets/applets.c:1.22->1.23 553 applets/applets.c:1.22->1.23
554 shell/cmdedit.c:1.88->1.89 554 shell/cmdedit.c:1.88->1.89
555 555
556--------------------- 556---------------------
557PatchSet 3968 557PatchSet 3968
558Date: 2004/02/22 11:25:13 558Date: 2004/02/22 11:25:13
559Author: bug1 559Author: bug1
560Branch: HEAD 560Branch: HEAD
561Tag: (none) 561Tag: (none)
562Log: 562Log:
563Patch from Vodz, cleanup memory usage, send strdup error messages to 563Patch from Vodz, cleanup memory usage, send strdup error messages to
564syslog. 564syslog.
565 565
566Members: 566Members:
567 networking/inetd.c:1.19->1.20 567 networking/inetd.c:1.19->1.20
568 568
569--------------------- 569---------------------
570PatchSet 3969 570PatchSet 3969
571Date: 2004/02/22 11:35:13 571Date: 2004/02/22 11:35:13
572Author: bug1 572Author: bug1
573Branch: HEAD 573Branch: HEAD
574Tag: (none) 574Tag: (none)
575Log: 575Log:
576Patch from Chris Larson (kergoth), to allow multiple directores to be 576Patch from Chris Larson (kergoth), to allow multiple directores to be
577unmounted at once. 577unmounted at once.
578 578
579Members: 579Members:
580 docs/busybox.sgml:1.52->1.53 580 docs/busybox.sgml:1.52->1.53
581 util-linux/umount.c:1.62->1.63 581 util-linux/umount.c:1.62->1.63
582 582
583--------------------- 583---------------------
584PatchSet 3970 584PatchSet 3970
585Date: 2004/02/22 11:46:49 585Date: 2004/02/22 11:46:49
586Author: andersen 586Author: andersen
587Branch: HEAD 587Branch: HEAD
588Tag: (none) 588Tag: (none)
589Log: 589Log:
590For the time being, revert the changes for detecting copying 590For the time being, revert the changes for detecting copying
591a directory into itself. It is harder to do this correctly 591a directory into itself. It is harder to do this correctly
592than it appears. Not trying at all seems a better compromise 592than it appears. Not trying at all seems a better compromise
593for the time being, untill we can implement this correctly. 593for the time being, untill we can implement this correctly.
594 594
595Members: 595Members:
596 libbb/copy_file.c:1.30->1.31 596 libbb/copy_file.c:1.30->1.31
597 597
598--------------------- 598---------------------
599PatchSet 3971 599PatchSet 3971
600Date: 2004/02/22 11:55:09 600Date: 2004/02/22 11:55:09
601Author: bug1 601Author: bug1
602Branch: HEAD 602Branch: HEAD
603Tag: (none) 603Tag: (none)
604Log: 604Log:
605Patch from Dmitry Zakharov, this line was missedfrom the last patch 605Patch from Dmitry Zakharov, this line was missedfrom the last patch
606 606
607Members: 607Members:
608 editors/awk.c:1.5->1.6 608 editors/awk.c:1.5->1.6
609 609
610--------------------- 610---------------------
611PatchSet 3972 611PatchSet 3972
612Date: 2004/02/22 12:17:33 612Date: 2004/02/22 12:17:33
613Author: bug1 613Author: bug1
614Branch: HEAD 614Branch: HEAD
615Tag: (none) 615Tag: (none)
616Log: 616Log:
617Fix from Paul Kortekaas for syslog -C option, size should be in kB. 617Fix from Paul Kortekaas for syslog -C option, size should be in kB.
618 618
619Members: 619Members:
620 sysklogd/syslogd.c:1.106->1.107 620 sysklogd/syslogd.c:1.106->1.107
621 621
622--------------------- 622---------------------
623PatchSet 3973 623PatchSet 3973
624Date: 2004/02/22 12:25:47 624Date: 2004/02/22 12:25:47
625Author: andersen 625Author: andersen
626Branch: HEAD 626Branch: HEAD
627Tag: (none) 627Tag: (none)
628Log: 628Log:
629Fernando Silveira writes: 629Fernando Silveira writes:
630 630
@@ -639,33 +639,33 @@ Hi,
639 639
640Thanks a lot! 640Thanks a lot!
641 641
642Members: 642Members:
643 include/usage.h:1.189->1.190 643 include/usage.h:1.189->1.190
644 networking/Config.in:1.26->1.27 644 networking/Config.in:1.26->1.27
645 networking/telnet.c:1.41->1.42 645 networking/telnet.c:1.41->1.42
646 646
647--------------------- 647---------------------
648PatchSet 3974 648PatchSet 3974
649Date: 2004/02/22 12:27:04 649Date: 2004/02/22 12:27:04
650Author: andersen 650Author: andersen
651Branch: HEAD 651Branch: HEAD
652Tag: (none) 652Tag: (none)
653Log: 653Log:
654Bump up version in preparation for -pre8 654Bump up version in preparation for -pre8
655 655
656Members: 656Members:
657 Rules.mak:1.27->1.28 657 Rules.mak:1.27->1.28
658 658
659--------------------- 659---------------------
660PatchSet 3975 660PatchSet 3975
661Date: 2004/02/23 08:11:07 661Date: 2004/02/23 08:11:07
662Author: bug1 662Author: bug1
663Branch: HEAD 663Branch: HEAD
664Tag: (none) 664Tag: (none)
665Log: 665Log:
666bb_full_fd_action was incorrectly returning an error message causing 666bb_full_fd_action was incorrectly returning an error message causing
667major breaking. 667major breaking.
668 668
669Members: 669Members:
670 libbb/copyfd.c:1.10->1.11 670 libbb/copyfd.c:1.10->1.11
671 671
diff --git a/INSTALL b/INSTALL
index a137da237..c9cdf8e26 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,10 +1,10 @@
11) Run 'make config' or 'make menuconfig' and select the 11) Run 'make config' or 'make menuconfig' and select the
2 functionality that you wish to enable. 2 functionality that you wish to enable.
3 3
42) Run 'make dep' 42) Run 'make dep'
5 5
63) Check the Makefile for any Makefile setting you wish 63) Check the Makefile for any Makefile setting you wish
7 to adjust for your system (things like like setting 7 to adjust for your system (things like like setting
8 your cross compiler, adjusting optimizations, etc) 8 your cross compiler, adjusting optimizations, etc)
9 9
104) Run 'make' 104) Run 'make'
diff --git a/Makefile b/Makefile
index fc8ea56f7..6ebab1ff2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -219,7 +219,7 @@ clean:
219 docs/busybox.net/BusyBox.html busybox.links libbb/loop.h \ 219 docs/busybox.net/BusyBox.html busybox.links libbb/loop.h \
220 .config.old .hdepend busybox 220 .config.old .hdepend busybox
221 - rm -rf _install 221 - rm -rf _install
222 - find . -name .\*.flags -exec rm -f {} \; 222 - find . -name .\*.flags -exec rm -f {} \;
223 - find . -name \*.o -exec rm -f {} \; 223 - find . -name \*.o -exec rm -f {} \;
224 - find . -name \*.a -exec rm -f {} \; 224 - find . -name \*.a -exec rm -f {} \;
225 225
diff --git a/README b/README
index e56cb5a47..14cc845f7 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
1Please see the LICENSE file for details on copying and usage. 1Please see the LICENSE file for details on copying and usage.
2 2
3BusyBox combines tiny versions of many common UNIX utilities into a single 3BusyBox combines tiny versions of many common UNIX utilities into a single
4small executable. It provides minimalist replacements for most of the utilities 4small executable. It provides minimalist replacements for most of the utilities
5you usually find in fileutils, shellutils, findutils, textutils, grep, gzip, 5you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
@@ -27,16 +27,16 @@ compiled in functions. By default, 'make install' will place the symlink
27forest into `pwd`/_install unless you have defined the PREFIX environment 27forest into `pwd`/_install unless you have defined the PREFIX environment
28variable (i.e., 'make PREFIX=/tmp/foo install') 28variable (i.e., 'make PREFIX=/tmp/foo install')
29 29
30If you wish to install hardlinks, rather than symlinks, you can use 30If you wish to install hardlinks, rather than symlinks, you can use
31'make install-hardlinks' instead. 31'make install-hardlinks' instead.
32 32
33---------------- 33----------------
34 34
35Supported architectures: 35Supported architectures:
36 36
37 Busybox in general will build on any architecture supported by gcc. It has 37 Busybox in general will build on any architecture supported by gcc. It has
38 a few specialized features added for __sparc__ and __alpha__. insmod 38 a few specialized features added for __sparc__ and __alpha__. insmod
39 functionality is currently limited to x86, ARM, SH3/4, powerpc, m68k, 39 functionality is currently limited to x86, ARM, SH3/4, powerpc, m68k,
40 MIPS, cris, and v850e. 40 MIPS, cris, and v850e.
41 41
42Supported libcs: 42Supported libcs:
@@ -69,7 +69,7 @@ Bugs:
69If you find bugs, please submit a detailed bug report to the busybox mailing 69If you find bugs, please submit a detailed bug report to the busybox mailing
70list at busybox@mail.busybox.net. A well-written bug report should include a 70list at busybox@mail.busybox.net. A well-written bug report should include a
71transcript of a shell session that demonstrates the bad behavior and enables 71transcript of a shell session that demonstrates the bad behavior and enables
72anyone else to duplicate the bug on their own machine. The following is such 72anyone else to duplicate the bug on their own machine. The following is such
73an example: 73an example:
74 74
75 To: busybox@mail.busybox.net 75 To: busybox@mail.busybox.net
@@ -90,7 +90,7 @@ an example:
90 $ date 90 $ date
91 llegal instruction 91 llegal instruction
92 92
93 I am using Debian unstable, kernel version 2.4.19-rmk1 on an Netwinder, 93 I am using Debian unstable, kernel version 2.4.19-rmk1 on an Netwinder,
94 and the latest uClibc from CVS. Thanks for the wonderful program! 94 and the latest uClibc from CVS. Thanks for the wonderful program!
95 95
96 -Diligent 96 -Diligent
@@ -103,8 +103,8 @@ reports lacking such detail may never be fixed... Thanks for understanding.
103 103
104FTP: 104FTP:
105 105
106Source for the latest released version, as well as daily snapshots, can always 106Source for the latest released version, as well as daily snapshots, can always
107be downloaded from 107be downloaded from
108 http://busybox.net/downloads/ 108 http://busybox.net/downloads/
109 109
110---------------- 110----------------
@@ -123,7 +123,7 @@ For those that are actively contributing there is even CVS write access:
123---------------- 123----------------
124 124
125Please feed suggestions, bug reports, insults, and bribes back to: 125Please feed suggestions, bug reports, insults, and bribes back to:
126 Erik Andersen 126 Erik Andersen
127 <andersen@codepoet.org> 127 <andersen@codepoet.org>
128 <andersen@codepoet.org> 128 <andersen@codepoet.org>
129 129
diff --git a/Rules.mak b/Rules.mak
index 7b6642631..5e0a5e672 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -1,6 +1,6 @@
1# Rules.make for busybox 1# Rules.make for busybox
2# 2#
3# Copyright (C) 2001-2003 Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -52,14 +52,14 @@ TARGET_OS=linux
52HOSTCC = gcc 52HOSTCC = gcc
53HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 53HOSTCFLAGS= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
54 54
55# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc. 55# Ensure consistent sort order, 'gcc -print-search-dirs' behavior, etc.
56LC_ALL:= C 56LC_ALL:= C
57 57
58# If you want to add some simple compiler switches (like -march=i686), 58# If you want to add some simple compiler switches (like -march=i686),
59# especially from the command line, use this instead of CFLAGS directly. 59# especially from the command line, use this instead of CFLAGS directly.
60# For optimization overrides, it's better still to set OPTIMIZATION. 60# For optimization overrides, it's better still to set OPTIMIZATION.
61CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS))) 61CFLAGS_EXTRA=$(subst ",, $(strip $(EXTRA_CFLAGS_OPTIONS)))
62 62
63# If you have a "pristine" source directory, point BB_SRC_DIR to it. 63# If you have a "pristine" source directory, point BB_SRC_DIR to it.
64# Experimental and incomplete; tell the mailing list 64# Experimental and incomplete; tell the mailing list
65# <busybox@busybox.net> if you do or don't like it so far. 65# <busybox@busybox.net> if you do or don't like it so far.
@@ -137,7 +137,7 @@ OPTIMIZATIONS=$(OPTIMIZATION) -fomit-frame-pointer
137# by itself, instead of following it by the same half-dozen overrides 137# by itself, instead of following it by the same half-dozen overrides
138# every time. The stuff below, on the other hand, is probably less 138# every time. The stuff below, on the other hand, is probably less
139# prone to casual user adjustment. 139# prone to casual user adjustment.
140# 140#
141 141
142ifeq ($(strip $(CONFIG_LFS)),y) 142ifeq ($(strip $(CONFIG_LFS)),y)
143 # For large file summit support 143 # For large file summit support
diff --git a/TODO b/TODO
index 35bc11a24..7a8fa4dfa 100644
--- a/TODO
+++ b/TODO
@@ -14,7 +14,7 @@ Possible apps to include some time:
14 14
15----------- 15-----------
16 16
17With sysvinit, reboot, poweroff and halt all used a named pipe, 17With sysvinit, reboot, poweroff and halt all used a named pipe,
18/dev/initctl, to communicate with the init process. Busybox 18/dev/initctl, to communicate with the init process. Busybox
19currently uses signals to communicate with init. This makes 19currently uses signals to communicate with init. This makes
20busybox incompatible with sysvinit. We should probably use 20busybox incompatible with sysvinit. We should probably use
diff --git a/applets/Makefile b/applets/Makefile
index f4ebb1496..5f9167442 100644
--- a/applets/Makefile
+++ b/applets/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/applets/Makefile.in b/applets/Makefile.in
index cb6c647df..79582e069 100644
--- a/applets/Makefile.in
+++ b/applets/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/applets/applets.c b/applets/applets.c
index 9dc69f36f..7d8adfb65 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -423,7 +423,7 @@ static void parse_config_file(void)
423 } 423 }
424 424
425 /* Now get the the user/group info. */ 425 /* Now get the the user/group info. */
426 426
427 s = (char *) bb_skip_whitespace(e); 427 s = (char *) bb_skip_whitespace(e);
428 428
429 /* Note: We require whitespace between the mode and the 429 /* Note: We require whitespace between the mode and the
diff --git a/applets/busybox.c b/applets/busybox.c
index dfcf400e0..dbb5e176b 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -13,7 +13,7 @@ int been_there_done_that = 0; /* Also used in applets.c */
13const char *bb_applet_name; 13const char *bb_applet_name;
14 14
15#ifdef CONFIG_FEATURE_INSTALLER 15#ifdef CONFIG_FEATURE_INSTALLER
16/* 16/*
17 * directory table 17 * directory table
18 * this should be consistent w/ the enum, busybox.h::Location, 18 * this should be consistent w/ the enum, busybox.h::Location,
19 * or else... 19 * or else...
@@ -32,7 +32,7 @@ static const char* const install_dir[] = {
32/* abstract link() */ 32/* abstract link() */
33typedef int (*__link_f)(const char *, const char *); 33typedef int (*__link_f)(const char *, const char *);
34 34
35/* 35/*
36 * Where in the filesystem is this busybox? 36 * Where in the filesystem is this busybox?
37 * [return] 37 * [return]
38 * malloc'd string w/ full pathname of busybox's location 38 * malloc'd string w/ full pathname of busybox's location
@@ -52,7 +52,7 @@ static void install_links(const char *busybox, int use_symbolic_links)
52 int i; 52 int i;
53 int rc; 53 int rc;
54 54
55 if (use_symbolic_links) 55 if (use_symbolic_links)
56 Link = symlink; 56 Link = symlink;
57 57
58 for (i = 0; applets[i].name != NULL; i++) { 58 for (i = 0; applets[i].name != NULL; i++) {
@@ -82,7 +82,7 @@ int main(int argc, char **argv)
82 bb_applet_name = s; 82 bb_applet_name = s;
83 } 83 }
84 84
85#ifdef CONFIG_LOCALE_SUPPORT 85#ifdef CONFIG_LOCALE_SUPPORT
86#ifdef CONFIG_INIT 86#ifdef CONFIG_INIT
87 if(getpid()!=1) /* Do not set locale for `init' */ 87 if(getpid()!=1) /* Do not set locale for `init' */
88#endif 88#endif
@@ -100,9 +100,9 @@ int busybox_main(int argc, char **argv)
100{ 100{
101 int col = 0, len, i; 101 int col = 0, len, i;
102 102
103#ifdef CONFIG_FEATURE_INSTALLER 103#ifdef CONFIG_FEATURE_INSTALLER
104 /* 104 /*
105 * This style of argument parsing doesn't scale well 105 * This style of argument parsing doesn't scale well
106 * in the event that busybox starts wanting more --options. 106 * in the event that busybox starts wanting more --options.
107 * If someone has a cleaner approach, by all means implement it. 107 * If someone has a cleaner approach, by all means implement it.
108 */ 108 */
@@ -113,8 +113,8 @@ int busybox_main(int argc, char **argv)
113 113
114 /* to use symlinks, or not to use symlinks... */ 114 /* to use symlinks, or not to use symlinks... */
115 if (argc > 2) { 115 if (argc > 2) {
116 if ((strcmp(argv[2], "-s") == 0)) { 116 if ((strcmp(argv[2], "-s") == 0)) {
117 use_symbolic_links = 1; 117 use_symbolic_links = 1;
118 } 118 }
119 } 119 }
120 120
@@ -150,7 +150,7 @@ int busybox_main(int argc, char **argv)
150 "\tBusyBox is a multi-call binary that combines many common Unix\n" 150 "\tBusyBox is a multi-call binary that combines many common Unix\n"
151 "\tutilities into a single executable. Most people will create a\n" 151 "\tutilities into a single executable. Most people will create a\n"
152 "\tlink to busybox for each function they wish to use, and BusyBox\n" 152 "\tlink to busybox for each function they wish to use, and BusyBox\n"
153 "\twill act like whatever it was invoked as.\n" 153 "\twill act like whatever it was invoked as.\n"
154 "\nCurrently defined functions:\n", bb_msg_full_version); 154 "\nCurrently defined functions:\n", bb_msg_full_version);
155 155
156 while (a->name != 0) { 156 while (a->name != 0) {
diff --git a/archival/Config.in b/archival/Config.in
index daf3cf221..db358db08 100644
--- a/archival/Config.in
+++ b/archival/Config.in
@@ -46,11 +46,11 @@ config CONFIG_BUNZIP2
46 sorting text compression algorithm, and Huffman coding. Compression 46 sorting text compression algorithm, and Huffman coding. Compression
47 is generally considerably better than that achieved by more 47 is generally considerably better than that achieved by more
48 conventional LZ77/LZ78-based compressors, and approaches the 48 conventional LZ77/LZ78-based compressors, and approaches the
49 performance of the PPM family of statistical compressors. 49 performance of the PPM family of statistical compressors.
50 50
51 The BusyBox bunzip2 applet is limited to de-compression only. 51 The BusyBox bunzip2 applet is limited to de-compression only.
52 On an x86 system, this applet adds about 11K. 52 On an x86 system, this applet adds about 11K.
53 53
54 Unless you have a specific application which requires bunzip2, you 54 Unless you have a specific application which requires bunzip2, you
55 should probably say N here. 55 should probably say N here.
56 56
@@ -63,7 +63,7 @@ config CONFIG_CPIO
63 cpio has 110 bytes of overheads for every stored file. 63 cpio has 110 bytes of overheads for every stored file.
64 64
65 This implementation of cpio can extract cpio archives created in the 65 This implementation of cpio can extract cpio archives created in the
66 "newc" or "crc" format, it cannot create or modify them. 66 "newc" or "crc" format, it cannot create or modify them.
67 67
68 Unless you have a specific application which requires cpio, you should 68 Unless you have a specific application which requires cpio, you should
69 probably say N here. 69 probably say N here.
@@ -73,7 +73,7 @@ config CONFIG_DPKG
73 default n 73 default n
74 help 74 help
75 dpkg is a medium-level tool to install, build, remove and manage Debian packages. 75 dpkg is a medium-level tool to install, build, remove and manage Debian packages.
76 76
77 This implementation of dpkg has a number of limitations, you should use the 77 This implementation of dpkg has a number of limitations, you should use the
78 official dpkg if possible. 78 official dpkg if possible.
79 79
@@ -82,9 +82,9 @@ config CONFIG_DPKG_DEB
82 default n 82 default n
83 help 83 help
84 dpkg-deb packs, unpacks and provides information about Debian archives. 84 dpkg-deb packs, unpacks and provides information about Debian archives.
85 85
86 This implementation of dpkg-deb cannot pack archives. 86 This implementation of dpkg-deb cannot pack archives.
87 87
88 Unless you have a specific application which requires dpkg-deb, you should 88 Unless you have a specific application which requires dpkg-deb, you should
89 probably say N here. 89 probably say N here.
90 90
@@ -94,7 +94,7 @@ config CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY
94 depends on CONFIG_DPKG_DEB 94 depends on CONFIG_DPKG_DEB
95 help 95 help
96 This reduces dpkg-deb to the equivalent of "ar -p <deb> data.tar.gz | tar -zx". 96 This reduces dpkg-deb to the equivalent of "ar -p <deb> data.tar.gz | tar -zx".
97 However it saves space as none of the extra dpkg-deb, ar or tar options are 97 However it saves space as none of the extra dpkg-deb, ar or tar options are
98 needed, they are linked to internally. 98 needed, they are linked to internally.
99 99
100config CONFIG_GUNZIP 100config CONFIG_GUNZIP
@@ -195,7 +195,7 @@ config CONFIG_FEATURE_TAR_GNU_EXTENSIONS
195 default y 195 default y
196 depends on CONFIG_TAR 196 depends on CONFIG_TAR
197 help 197 help
198 With this option busybox supports GNU long filenames and 198 With this option busybox supports GNU long filenames and
199 linknames. 199 linknames.
200 200
201config CONFIG_FEATURE_TAR_LONG_OPTIONS 201config CONFIG_FEATURE_TAR_LONG_OPTIONS
@@ -241,7 +241,7 @@ config CONFIG_FEATURE_DEB_TAR_GZ
241 depends on CONFIG_DPKG || CONFIG_DPKG_DEB 241 depends on CONFIG_DPKG || CONFIG_DPKG_DEB
242 help 242 help
243 This is the default compression method inside the debian ar file. 243 This is the default compression method inside the debian ar file.
244 244
245 If you want compatibility with standard .deb's you should say yes here. 245 If you want compatibility with standard .deb's you should say yes here.
246 246
247config CONFIG_FEATURE_DEB_TAR_BZ2 247config CONFIG_FEATURE_DEB_TAR_BZ2
@@ -251,7 +251,7 @@ config CONFIG_FEATURE_DEB_TAR_BZ2
251 help 251 help
252 This allows dpkg and dpkg-deb to extract deb's that are compressed internally 252 This allows dpkg and dpkg-deb to extract deb's that are compressed internally
253 with bzip2 instead of gzip. 253 with bzip2 instead of gzip.
254 254
255 You only want this if you are creating your own custom debian packages that 255 You only want this if you are creating your own custom debian packages that
256 use an internal control.tar.bz2 or data.tar.bz2. 256 use an internal control.tar.bz2 or data.tar.bz2.
257 257
diff --git a/archival/Makefile b/archival/Makefile
index 3362feafb..1cbe7ee00 100644
--- a/archival/Makefile
+++ b/archival/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/archival/Makefile.in b/archival/Makefile.in
index 3247ad8bd..1673662f9 100644
--- a/archival/Makefile.in
+++ b/archival/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/archival/ar.c b/archival/ar.c
index 890e81fc5..ddf3fdadb 100644
--- a/archival/ar.c
+++ b/archival/ar.c
@@ -1,10 +1,10 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Mini ar implementation for busybox 3 * Mini ar implementation for busybox
4 * 4 *
5 * Copyright (C) 2000 by Glenn McGrath 5 * Copyright (C) 2000 by Glenn McGrath
6 * Written by Glenn McGrath <bug1@optushome.com.au> 1 June 2000 6 * Written by Glenn McGrath <bug1@optushome.com.au> 1 June 2000
7 * 7 *
8 * Based in part on BusyBox tar, Debian dpkg-deb and GNU ar. 8 * Based in part on BusyBox tar, Debian dpkg-deb and GNU ar.
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
diff --git a/archival/cpio.c b/archival/cpio.c
index 8f85779c9..aff6a55f9 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini cpio implementation for busybox 3 * Mini cpio implementation for busybox
4 * 4 *
5 * Copyright (C) 2001 by Glenn McGrath 5 * Copyright (C) 2001 by Glenn McGrath
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@ extern int cpio_main(int argc, char **argv)
62 /* if both extract and test option are given, ignore extract option */ 62 /* if both extract and test option are given, ignore extract option */
63 if (opt & CPIO_OPT_EXTRACT) { 63 if (opt & CPIO_OPT_EXTRACT) {
64 opt &= ~CPIO_OPT_EXTRACT; 64 opt &= ~CPIO_OPT_EXTRACT;
65 } 65 }
66 archive_handle->action_header = header_list; 66 archive_handle->action_header = header_list;
67 } 67 }
68 if (opt & CPIO_OPT_EXTRACT) { 68 if (opt & CPIO_OPT_EXTRACT) {
diff --git a/archival/dpkg.c b/archival/dpkg.c
index 2ebbbdf4e..e192b4a62 100644
--- a/archival/dpkg.c
+++ b/archival/dpkg.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Written By Glenn McGrath with the help of others 5 * Written By Glenn McGrath with the help of others
6 * Copyright (C) 2001 by Glenn McGrath 6 * Copyright (C) 2001 by Glenn McGrath
7 * 7 *
8 * Started life as a busybox implementation of udpkg 8 * Started life as a busybox implementation of udpkg
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
@@ -54,7 +54,7 @@
54 * int's and chaos is assured, 16381 is the max prime for 14 bit field 54 * int's and chaos is assured, 16381 is the max prime for 14 bit field
55 */ 55 */
56 56
57/* NAME_HASH_PRIME, Stores package names and versions, 57/* NAME_HASH_PRIME, Stores package names and versions,
58 * I estimate it should be at least 50% bigger than PACKAGE_HASH_PRIME, 58 * I estimate it should be at least 50% bigger than PACKAGE_HASH_PRIME,
59 * as there a lot of duplicate version numbers */ 59 * as there a lot of duplicate version numbers */
60#define NAME_HASH_PRIME 16381 60#define NAME_HASH_PRIME 16381
@@ -150,7 +150,7 @@ void make_hash(const char *key, unsigned int *start, unsigned int *decrement, co
150 * shift amount is mod 24 because long int is 32 bit and data 150 * shift amount is mod 24 because long int is 32 bit and data
151 * to be shifted is 8, dont want to shift data to where it has 151 * to be shifted is 8, dont want to shift data to where it has
152 * no effect*/ 152 * no effect*/
153 hash_num += ((key[i] + key[i-1]) << ((key[i] * i) % 24)); 153 hash_num += ((key[i] + key[i-1]) << ((key[i] * i) % 24));
154 } 154 }
155 *start = (unsigned int) hash_num % hash_prime; 155 *start = (unsigned int) hash_num % hash_prime;
156 *decrement = (unsigned int) 1 + (hash_num % (hash_prime - 1)); 156 *decrement = (unsigned int) 1 + (hash_num % (hash_prime - 1));
@@ -464,11 +464,11 @@ void add_split_dependencies(common_node_t *parent_node, const char *whole_line,
464 } else { 464 } else {
465 or_edge = NULL; 465 or_edge = NULL;
466 } 466 }
467 467
468 if ( or_edge ) { 468 if ( or_edge ) {
469 or_edge->name = search_name_hashtable(field); 469 or_edge->name = search_name_hashtable(field);
470 or_edge->version = 0; // tracks the number of altenatives 470 or_edge->version = 0; // tracks the number of altenatives
471 471
472 add_edge_to_node(parent_node, or_edge); 472 add_edge_to_node(parent_node, or_edge);
473 } 473 }
474 474
@@ -572,7 +572,7 @@ unsigned int fill_package_struct(char *control_buffer)
572 goto fill_package_struct_cleanup; /* Oh no, the dreaded goto statement ! */ 572 goto fill_package_struct_cleanup; /* Oh no, the dreaded goto statement ! */
573 } 573 }
574 574
575 field_num = compare_string_array(field_names, field_name); 575 field_num = compare_string_array(field_names, field_name);
576 switch(field_num) { 576 switch(field_num) {
577 case 0: /* Package */ 577 case 0: /* Package */
578 new_node->name = search_name_hashtable(field_value); 578 new_node->name = search_name_hashtable(field_value);
@@ -697,7 +697,7 @@ const char *describe_status(int status_num) {
697 return "is marked to be removed"; 697 return "is marked to be removed";
698 if ( status_want == search_name_hashtable("purge") ) 698 if ( status_want == search_name_hashtable("purge") )
699 return "is marked to be purged"; 699 return "is marked to be purged";
700 } 700 }
701 if ( status_want == search_name_hashtable("unknown") ) 701 if ( status_want == search_name_hashtable("unknown") )
702 return "is in an indeterminate state"; 702 return "is in an indeterminate state";
703 if ( status_want == search_name_hashtable("install") ) 703 if ( status_want == search_name_hashtable("install") )
@@ -957,11 +957,11 @@ void write_status_file(deb_file_t **deb_file)
957 957
958 /* Create a seperate backfile to dpkg */ 958 /* Create a seperate backfile to dpkg */
959 if (rename("/var/lib/dpkg/status", "/var/lib/dpkg/status.udeb.bak") == -1) { 959 if (rename("/var/lib/dpkg/status", "/var/lib/dpkg/status.udeb.bak") == -1) {
960 struct stat stat_buf; 960 struct stat stat_buf;
961 if (stat("/var/lib/dpkg/status", &stat_buf) == 0) { 961 if (stat("/var/lib/dpkg/status", &stat_buf) == 0) {
962 bb_error_msg_and_die("Couldnt create backup status file"); 962 bb_error_msg_and_die("Couldnt create backup status file");
963 } 963 }
964 /* Its ok if renaming the status file fails becasue status 964 /* Its ok if renaming the status file fails becasue status
965 * file doesnt exist, maybe we are starting from scratch */ 965 * file doesnt exist, maybe we are starting from scratch */
966 bb_error_msg("No status file found, creating new one"); 966 bb_error_msg("No status file found, creating new one");
967 } 967 }
@@ -1056,10 +1056,10 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
1056 const edge_t *package_edge = package_node->edge[j]; 1056 const edge_t *package_edge = package_node->edge[j];
1057 1057
1058 if (package_edge->type == EDGE_CONFLICTS) { 1058 if (package_edge->type == EDGE_CONFLICTS) {
1059 const unsigned int package_num = 1059 const unsigned int package_num =
1060 search_package_hashtable(package_edge->name, 1060 search_package_hashtable(package_edge->name,
1061 package_edge->version, 1061 package_edge->version,
1062 package_edge->operator); 1062 package_edge->operator);
1063 int result = 0; 1063 int result = 0;
1064 if (package_hashtable[package_num] != NULL) { 1064 if (package_hashtable[package_num] != NULL) {
1065 status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]); 1065 status_num = search_status_hashtable(name_hashtable[package_hashtable[package_num]->name]);
@@ -1078,7 +1078,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
1078 } 1078 }
1079 } 1079 }
1080 i++; 1080 i++;
1081 } 1081 }
1082 1082
1083 1083
1084 /* Check dependendcies */ 1084 /* Check dependendcies */
@@ -1098,7 +1098,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
1098 1098
1099 /* If there is no status then this package is a 1099 /* If there is no status then this package is a
1100 * virtual one provided by something else. In which 1100 * virtual one provided by something else. In which
1101 * case there are no dependencies to check. 1101 * case there are no dependencies to check.
1102 */ 1102 */
1103 if ( status_hashtable[status_num] == NULL ) continue; 1103 if ( status_hashtable[status_num] == NULL ) continue;
1104 1104
@@ -1125,7 +1125,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
1125 for (j = 0; j < package_node->num_of_edges; j++) { 1125 for (j = 0; j < package_node->num_of_edges; j++) {
1126 const edge_t *package_edge = package_node->edge[j]; 1126 const edge_t *package_edge = package_node->edge[j];
1127 unsigned int package_num; 1127 unsigned int package_num;
1128 1128
1129 if ( package_edge->type == EDGE_OR_PRE_DEPENDS || 1129 if ( package_edge->type == EDGE_OR_PRE_DEPENDS ||
1130 package_edge->type == EDGE_OR_DEPENDS ) { /* start an EDGE_OR_ list */ 1130 package_edge->type == EDGE_OR_DEPENDS ) { /* start an EDGE_OR_ list */
1131 number_of_alternatives = package_edge->version; 1131 number_of_alternatives = package_edge->version;
@@ -1147,26 +1147,26 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
1147 * this edge is the right type. 1147 * this edge is the right type.
1148 * 1148 *
1149 * EDGE_DEPENDS == OR_DEPENDS -1 1149 * EDGE_DEPENDS == OR_DEPENDS -1
1150 * EDGE_PRE_DEPENDS == OR_PRE_DEPENDS -1 1150 * EDGE_PRE_DEPENDS == OR_PRE_DEPENDS -1
1151 */ 1151 */
1152 if ( root_of_alternatives && package_edge->type != root_of_alternatives->type - 1) 1152 if ( root_of_alternatives && package_edge->type != root_of_alternatives->type - 1)
1153 bb_error_msg_and_die("Fatal error. Package dependencies corrupt: %d != %d - 1 \n", 1153 bb_error_msg_and_die("Fatal error. Package dependencies corrupt: %d != %d - 1 \n",
1154 package_edge->type, root_of_alternatives->type); 1154 package_edge->type, root_of_alternatives->type);
1155 1155
1156 if (package_hashtable[package_num] != NULL) 1156 if (package_hashtable[package_num] != NULL)
1157 result = !package_satisfies_dependency(package_num, package_edge->type); 1157 result = !package_satisfies_dependency(package_num, package_edge->type);
1158 1158
1159 if (result) { /* check for other package which provide what we are looking for */ 1159 if (result) { /* check for other package which provide what we are looking for */
1160 int provider = -1; 1160 int provider = -1;
1161 1161
1162 while ( (provider = search_for_provides(package_edge->name, provider) ) > -1 ) { 1162 while ( (provider = search_for_provides(package_edge->name, provider) ) > -1 ) {
1163 if ( package_hashtable[provider] == NULL ) { 1163 if ( package_hashtable[provider] == NULL ) {
1164 printf("Have a provider but no package information for it\n"); 1164 printf("Have a provider but no package information for it\n");
1165 continue; 1165 continue;
1166 } 1166 }
1167 result = !package_satisfies_dependency(provider, package_edge->type); 1167 result = !package_satisfies_dependency(provider, package_edge->type);
1168 1168
1169 if ( result == 0 ) 1169 if ( result == 0 )
1170 break; 1170 break;
1171 } 1171 }
1172 } 1172 }
@@ -1176,14 +1176,14 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
1176 if (result && number_of_alternatives == 0) { 1176 if (result && number_of_alternatives == 0) {
1177 if ( root_of_alternatives ) 1177 if ( root_of_alternatives )
1178 bb_error_msg_and_die( 1178 bb_error_msg_and_die(
1179 "Package %s %sdepends on %s, " 1179 "Package %s %sdepends on %s, "
1180 "which cannot be satisfied", 1180 "which cannot be satisfied",
1181 name_hashtable[package_node->name], 1181 name_hashtable[package_node->name],
1182 package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "", 1182 package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
1183 name_hashtable[root_of_alternatives->name]); 1183 name_hashtable[root_of_alternatives->name]);
1184 else 1184 else
1185 bb_error_msg_and_die( 1185 bb_error_msg_and_die(
1186 "Package %s %sdepends on %s, which %s\n", 1186 "Package %s %sdepends on %s, which %s\n",
1187 name_hashtable[package_node->name], 1187 name_hashtable[package_node->name],
1188 package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "", 1188 package_edge->type == EDGE_PRE_DEPENDS ? "pre-" : "",
1189 name_hashtable[package_edge->name], 1189 name_hashtable[package_edge->name],
@@ -1192,7 +1192,7 @@ int check_deps(deb_file_t **deb_file, int deb_start, int dep_max_count)
1192 /* we've found a package which 1192 /* we've found a package which
1193 * satisfies the dependency, 1193 * satisfies the dependency,
1194 * so skip over the rest of 1194 * so skip over the rest of
1195 * the alternatives. 1195 * the alternatives.
1196 */ 1196 */
1197 j += number_of_alternatives; 1197 j += number_of_alternatives;
1198 number_of_alternatives = 0; 1198 number_of_alternatives = 0;
@@ -1312,7 +1312,7 @@ char **all_control_list(const char *package_name)
1312 1312
1313void free_array(char **array) 1313void free_array(char **array)
1314{ 1314{
1315 1315
1316 if (array) { 1316 if (array) {
1317 unsigned short i = 0; 1317 unsigned short i = 0;
1318 while (array[i]) { 1318 while (array[i]) {
@@ -1325,7 +1325,7 @@ void free_array(char **array)
1325 1325
1326/* This function lists information on the installed packages. It loops through 1326/* This function lists information on the installed packages. It loops through
1327 * the status_hashtable to retrieve the info. This results in smaller code than 1327 * the status_hashtable to retrieve the info. This results in smaller code than
1328 * scanning the status file. The resulting list, however, is unsorted. 1328 * scanning the status file. The resulting list, however, is unsorted.
1329 */ 1329 */
1330void list_packages(void) 1330void list_packages(void)
1331{ 1331{
@@ -1333,7 +1333,7 @@ void list_packages(void)
1333 1333
1334 printf(" Name Version\n"); 1334 printf(" Name Version\n");
1335 printf("+++-==============-==============\n"); 1335 printf("+++-==============-==============\n");
1336 1336
1337 /* go through status hash, dereference package hash and finally strings */ 1337 /* go through status hash, dereference package hash and finally strings */
1338 for (i=0; i<STATUS_HASH_PRIME+1; i++) { 1338 for (i=0; i<STATUS_HASH_PRIME+1; i++) {
1339 1339
@@ -1342,22 +1342,22 @@ void list_packages(void)
1342 const char *name_str; /* package name */ 1342 const char *name_str; /* package name */
1343 const char *vers_str; /* version */ 1343 const char *vers_str; /* version */
1344 char s1, s2; /* status abbreviations */ 1344 char s1, s2; /* status abbreviations */
1345 int spccnt; /* space count */ 1345 int spccnt; /* space count */
1346 int j; 1346 int j;
1347 1347
1348 stat_str = name_hashtable[status_hashtable[i]->status]; 1348 stat_str = name_hashtable[status_hashtable[i]->status];
1349 name_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->name]; 1349 name_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->name];
1350 vers_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->version]; 1350 vers_str = name_hashtable[package_hashtable[status_hashtable[i]->package]->version];
1351 1351
1352 /* get abbreviation for status field 1 */ 1352 /* get abbreviation for status field 1 */
1353 s1 = stat_str[0] == 'i' ? 'i' : 'r'; 1353 s1 = stat_str[0] == 'i' ? 'i' : 'r';
1354 1354
1355 /* get abbreviation for status field 2 */ 1355 /* get abbreviation for status field 2 */
1356 for (j=0, spccnt=0; stat_str[j] && spccnt<2; j++) { 1356 for (j=0, spccnt=0; stat_str[j] && spccnt<2; j++) {
1357 if (stat_str[j] == ' ') spccnt++; 1357 if (stat_str[j] == ' ') spccnt++;
1358 } 1358 }
1359 s2 = stat_str[j]; 1359 s2 = stat_str[j];
1360 1360
1361 /* print out the line formatted like Debian dpkg */ 1361 /* print out the line formatted like Debian dpkg */
1362 printf("%c%c %-14s %s\n", s1, s2, name_str, vers_str); 1362 printf("%c%c %-14s %s\n", s1, s2, name_str, vers_str);
1363 } 1363 }
@@ -1376,7 +1376,7 @@ void remove_package(const unsigned int package_num, int noisy)
1376 char conffile_name[package_name_length + 30]; 1376 char conffile_name[package_name_length + 30];
1377 int return_value; 1377 int return_value;
1378 1378
1379 if ( noisy ) 1379 if ( noisy )
1380 printf("Removing %s (%s) ...\n", package_name, package_version); 1380 printf("Removing %s (%s) ...\n", package_name, package_version);
1381 1381
1382 /* run prerm script */ 1382 /* run prerm script */
@@ -1464,12 +1464,12 @@ static archive_handle_t *init_archive_deb_ar(const char *filename)
1464{ 1464{
1465 archive_handle_t *ar_handle; 1465 archive_handle_t *ar_handle;
1466 1466
1467 /* Setup an ar archive handle that refers to the gzip sub archive */ 1467 /* Setup an ar archive handle that refers to the gzip sub archive */
1468 ar_handle = init_handle(); 1468 ar_handle = init_handle();
1469 ar_handle->filter = filter_accept_list_reassign; 1469 ar_handle->filter = filter_accept_list_reassign;
1470 ar_handle->src_fd = bb_xopen(filename, O_RDONLY); 1470 ar_handle->src_fd = bb_xopen(filename, O_RDONLY);
1471 1471
1472 return(ar_handle); 1472 return(ar_handle);
1473} 1473}
1474 1474
1475static void init_archive_deb_control(archive_handle_t *ar_handle) 1475static void init_archive_deb_control(archive_handle_t *ar_handle)
@@ -1491,7 +1491,7 @@ static void init_archive_deb_control(archive_handle_t *ar_handle)
1491 /* Assign the tar handle as a subarchive of the ar handle */ 1491 /* Assign the tar handle as a subarchive of the ar handle */
1492 ar_handle->sub_archive = tar_handle; 1492 ar_handle->sub_archive = tar_handle;
1493 1493
1494 return; 1494 return;
1495} 1495}
1496 1496
1497static void init_archive_deb_data(archive_handle_t *ar_handle) 1497static void init_archive_deb_data(archive_handle_t *ar_handle)
@@ -1513,7 +1513,7 @@ static void init_archive_deb_data(archive_handle_t *ar_handle)
1513 /* Assign the tar handle as a subarchive of the ar handle */ 1513 /* Assign the tar handle as a subarchive of the ar handle */
1514 ar_handle->sub_archive = tar_handle; 1514 ar_handle->sub_archive = tar_handle;
1515 1515
1516 return; 1516 return;
1517} 1517}
1518 1518
1519static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, llist_t *myaccept) 1519static char *deb_extract_control_file_to_buffer(archive_handle_t *ar_handle, llist_t *myaccept)
@@ -1586,7 +1586,7 @@ static void unpack_package(deb_file_t *deb_file)
1586 if (run_package_script(package_name, "preinst") != 0) { 1586 if (run_package_script(package_name, "preinst") != 0) {
1587 /* when preinst returns exit code != 0 then quit installation process */ 1587 /* when preinst returns exit code != 0 then quit installation process */
1588 bb_error_msg_and_die("subprocess pre-installation script returned error."); 1588 bb_error_msg_and_die("subprocess pre-installation script returned error.");
1589 } 1589 }
1590 1590
1591 /* Extract data.tar.gz to the root directory */ 1591 /* Extract data.tar.gz to the root directory */
1592 archive_handle = init_archive_deb_ar(deb_file->filename); 1592 archive_handle = init_archive_deb_ar(deb_file->filename);
@@ -1598,7 +1598,7 @@ static void unpack_package(deb_file_t *deb_file)
1598 1598
1599 /* Create the list file */ 1599 /* Create the list file */
1600 strcat(info_prefix, "list"); 1600 strcat(info_prefix, "list");
1601 out_stream = bb_xfopen(info_prefix, "w"); 1601 out_stream = bb_xfopen(info_prefix, "w");
1602 while (archive_handle->sub_archive->passed) { 1602 while (archive_handle->sub_archive->passed) {
1603 /* the leading . has been stripped by data_extract_all_prefix already */ 1603 /* the leading . has been stripped by data_extract_all_prefix already */
1604 fputs(archive_handle->sub_archive->passed->data, out_stream); 1604 fputs(archive_handle->sub_archive->passed->data, out_stream);
@@ -1653,7 +1653,7 @@ int dpkg_main(int argc, char **argv)
1653 case 'F': // equivalent to --force in official dpkg 1653 case 'F': // equivalent to --force in official dpkg
1654 if (strcmp(optarg, "depends") == 0) { 1654 if (strcmp(optarg, "depends") == 0) {
1655 dpkg_opt |= dpkg_opt_force_ignore_depends; 1655 dpkg_opt |= dpkg_opt_force_ignore_depends;
1656 } 1656 }
1657 break; 1657 break;
1658 case 'i': 1658 case 'i':
1659 dpkg_opt |= dpkg_opt_install; 1659 dpkg_opt |= dpkg_opt_install;
@@ -1691,7 +1691,7 @@ int dpkg_main(int argc, char **argv)
1691 list_packages(); 1691 list_packages();
1692 return(EXIT_SUCCESS); 1692 return(EXIT_SUCCESS);
1693 } 1693 }
1694 1694
1695 /* Read arguments and store relevant info in structs */ 1695 /* Read arguments and store relevant info in structs */
1696 while (optind < argc) { 1696 while (optind < argc) {
1697 /* deb_count = nb_elem - 1 and we need nb_elem + 1 to allocate terminal node [NULL pointer] */ 1697 /* deb_count = nb_elem - 1 and we need nb_elem + 1 to allocate terminal node [NULL pointer] */
diff --git a/archival/dpkg_deb.c b/archival/dpkg_deb.c
index da94b394f..5aa9881d5 100644
--- a/archival/dpkg_deb.c
+++ b/archival/dpkg_deb.c
@@ -41,7 +41,7 @@ extern int dpkg_deb_main(int argc, char **argv)
41 /* Setup the tar archive handle */ 41 /* Setup the tar archive handle */
42 tar_archive = init_handle(); 42 tar_archive = init_handle();
43 43
44 /* Setup an ar archive handle that refers to the gzip sub archive */ 44 /* Setup an ar archive handle that refers to the gzip sub archive */
45 ar_archive = init_handle(); 45 ar_archive = init_handle();
46 ar_archive->sub_archive = tar_archive; 46 ar_archive->sub_archive = tar_archive;
47 ar_archive->filter = filter_accept_list_reassign; 47 ar_archive->filter = filter_accept_list_reassign;
@@ -73,7 +73,7 @@ extern int dpkg_deb_main(int argc, char **argv)
73 } 73 }
74 if (opt & DPKG_DEB_OPT_FIELD) { 74 if (opt & DPKG_DEB_OPT_FIELD) {
75 /* Print the entire control file 75 /* Print the entire control file
76 * it should accept a second argument which specifies a 76 * it should accept a second argument which specifies a
77 * specific field to print */ 77 * specific field to print */
78 ar_archive->accept = control_tar_llist; 78 ar_archive->accept = control_tar_llist;
79 tar_archive->accept = llist_add_to(NULL, "./control");; 79 tar_archive->accept = llist_add_to(NULL, "./control");;
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 367e0470c..dec53f660 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -13,7 +13,7 @@
13 * 13 *
14 * General cleanup to better adhere to the style guide and make use of standard 14 * General cleanup to better adhere to the style guide and make use of standard
15 * busybox functions by Glenn McGrath <bug1@optushome.com.au> 15 * busybox functions by Glenn McGrath <bug1@optushome.com.au>
16 * 16 *
17 * This program is free software; you can redistribute it and/or modify 17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or 19 * the Free Software Foundation; either version 2 of the License, or
@@ -153,12 +153,12 @@ extern int gunzip_main(int argc, char **argv)
153 /* do the decompression, and cleanup */ 153 /* do the decompression, and cleanup */
154 if (bb_xread_char(src_fd) == 0x1f) { 154 if (bb_xread_char(src_fd) == 0x1f) {
155 unsigned char magic2; 155 unsigned char magic2;
156 156
157 magic2 = bb_xread_char(src_fd); 157 magic2 = bb_xread_char(src_fd);
158#ifdef CONFIG_FEATURE_GUNZIP_UNCOMPRESS 158#ifdef CONFIG_FEATURE_GUNZIP_UNCOMPRESS
159 if (magic2 == 0x9d) { 159 if (magic2 == 0x9d) {
160 status = uncompress(src_fd, dst_fd); 160 status = uncompress(src_fd, dst_fd);
161 } else 161 } else
162#endif 162#endif
163 if (magic2 == 0x8b) { 163 if (magic2 == 0x8b) {
164 check_header_gzip(src_fd); 164 check_header_gzip(src_fd);
diff --git a/archival/gzip.c b/archival/gzip.c
index 2be5603a0..1708ac1a1 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -9,8 +9,8 @@
9 * only standard in to standard out with -9 compression. It also requires 9 * only standard in to standard out with -9 compression. It also requires
10 * the zcat module for some important functions." 10 * the zcat module for some important functions."
11 * 11 *
12 * Adjusted further by Erik Andersen <andersen@codepoet.org> to support 12 * Adjusted further by Erik Andersen <andersen@codepoet.org> to support
13 * files as well as stdin/stdout, and to generally behave itself wrt 13 * files as well as stdin/stdout, and to generally behave itself wrt
14 * command line handling. 14 * command line handling.
15 * 15 *
16 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
@@ -30,7 +30,7 @@
30 */ 30 */
31 31
32/* These defines are very important for BusyBox. Without these, 32/* These defines are very important for BusyBox. Without these,
33 * huge chunks of ram are pre-allocated making the BusyBox bss 33 * huge chunks of ram are pre-allocated making the BusyBox bss
34 * size Freaking Huge(tm), which is a bad thing.*/ 34 * size Freaking Huge(tm), which is a bad thing.*/
35#define SMALL_MEM 35#define SMALL_MEM
36#define DYN_ALLOC 36#define DYN_ALLOC
diff --git a/archival/libunarchive/Makefile b/archival/libunarchive/Makefile
index 272ca2434..9a20ea28b 100644
--- a/archival/libunarchive/Makefile
+++ b/archival/libunarchive/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/archival/libunarchive/Makefile.in b/archival/libunarchive/Makefile.in
index 09b0571ed..c0e12a6c8 100644
--- a/archival/libunarchive/Makefile.in
+++ b/archival/libunarchive/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
@@ -55,7 +55,7 @@ DPKG_FILES:= \
55 get_header_tar.o \ 55 get_header_tar.o \
56 filter_accept_list_reassign.o 56 filter_accept_list_reassign.o
57 57
58LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o 58LIBUNARCHIVE-$(CONFIG_AR) += get_header_ar.o unpack_ar_archive.o
59LIBUNARCHIVE-$(CONFIG_BUNZIP2) += decompress_bunzip2.o 59LIBUNARCHIVE-$(CONFIG_BUNZIP2) += decompress_bunzip2.o
60LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o 60LIBUNARCHIVE-$(CONFIG_CPIO) += get_header_cpio.o
61LIBUNARCHIVE-$(CONFIG_DPKG) += $(DPKG_FILES) 61LIBUNARCHIVE-$(CONFIG_DPKG) += $(DPKG_FILES)
@@ -64,7 +64,7 @@ LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_GZ) += $(GUNZIP_FILES) get_header_tar_gz.o
64LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_BZ2) += decompress_bunzip2.o get_header_tar_bz2.o 64LIBUNARCHIVE-$(CONFIG_FEATURE_DEB_TAR_BZ2) += decompress_bunzip2.o get_header_tar_bz2.o
65LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES) 65LIBUNARCHIVE-$(CONFIG_GUNZIP) += $(GUNZIP_FILES)
66LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += uncompress.o 66LIBUNARCHIVE-$(CONFIG_FEATURE_GUNZIP_UNCOMPRESS) += uncompress.o
67LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o 67LIBUNARCHIVE-$(CONFIG_RPM2CPIO) += $(GUNZIP_FILES) get_header_cpio.o
68LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o 68LIBUNARCHIVE-$(CONFIG_RPM) += $(GUNZIP_FILES) get_header_cpio.o
69LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o 69LIBUNARCHIVE-$(CONFIG_TAR) += get_header_tar.o
70LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o 70LIBUNARCHIVE-$(CONFIG_FEATURE_TAR_BZIP2) += decompress_bunzip2.o get_header_tar_bz2.o
diff --git a/archival/libunarchive/data_extract_all.c b/archival/libunarchive/data_extract_all.c
index 4cff24339..a9a3a93d8 100644
--- a/archival/libunarchive/data_extract_all.c
+++ b/archival/libunarchive/data_extract_all.c
@@ -37,7 +37,7 @@ extern void data_extract_all(archive_handle_t *archive_handle)
37 char *name = bb_xstrdup(file_header->name); 37 char *name = bb_xstrdup(file_header->name);
38 bb_make_directory (dirname(name), 0777, FILEUTILS_RECUR); 38 bb_make_directory (dirname(name), 0777, FILEUTILS_RECUR);
39 free(name); 39 free(name);
40 } 40 }
41 41
42 /* Check if the file already exists */ 42 /* Check if the file already exists */
43 if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) { 43 if (archive_handle->flags & ARCHIVE_EXTRACT_UNCONDITIONAL) {
@@ -66,7 +66,7 @@ extern void data_extract_all(archive_handle_t *archive_handle)
66 } 66 }
67 } 67 }
68 68
69 /* Handle hard links seperately 69 /* Handle hard links seperately
70 * We identified hard links as regular files of size 0 with a symlink */ 70 * We identified hard links as regular files of size 0 with a symlink */
71 if (S_ISREG(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) { 71 if (S_ISREG(file_header->mode) && (file_header->link_name) && (file_header->size == 0)) {
72 /* hard link */ 72 /* hard link */
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c
index 3e6138c95..af165336e 100644
--- a/archival/libunarchive/decompress_bunzip2.c
+++ b/archival/libunarchive/decompress_bunzip2.c
@@ -248,7 +248,7 @@ static int get_next_block(bunzip_data *bd)
248 pp=0; 248 pp=0;
249 for(i=minLen;i<=maxLen;i++) { 249 for(i=minLen;i<=maxLen;i++) {
250 temp[i]=limit[i]=0; 250 temp[i]=limit[i]=0;
251 for(t=0;t<symCount;t++) 251 for(t=0;t<symCount;t++)
252 if(length[t]==i) hufGroup->permute[pp++] = t; 252 if(length[t]==i) hufGroup->permute[pp++] = t;
253 } 253 }
254 /* Count symbols coded for at each bit length */ 254 /* Count symbols coded for at each bit length */
diff --git a/archival/libunarchive/decompress_uncompress.c b/archival/libunarchive/decompress_uncompress.c
index 65418a7ca..ddf293fd6 100644
--- a/archival/libunarchive/decompress_uncompress.c
+++ b/archival/libunarchive/decompress_uncompress.c
@@ -3,7 +3,7 @@
3 3
4/* uncompress for busybox -- (c) 2002 Robert Griebl 4/* uncompress for busybox -- (c) 2002 Robert Griebl
5 * 5 *
6 * based on the original compress42.c source 6 * based on the original compress42.c source
7 * (see disclaimer below) 7 * (see disclaimer below)
8 */ 8 */
9 9
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c
index 29929c282..a436db191 100644
--- a/archival/libunarchive/decompress_unzip.c
+++ b/archival/libunarchive/decompress_unzip.c
@@ -13,7 +13,7 @@
13 * 13 *
14 * General cleanup to better adhere to the style guide and make use of standard 14 * General cleanup to better adhere to the style guide and make use of standard
15 * busybox functions by Glenn McGrath <bug1@optushome.com.au> 15 * busybox functions by Glenn McGrath <bug1@optushome.com.au>
16 * 16 *
17 * read_gz interface + associated hacking by Laurence Anderson 17 * read_gz interface + associated hacking by Laurence Anderson
18 * 18 *
19 * This program is free software; you can redistribute it and/or modify 19 * This program is free software; you can redistribute it and/or modify
@@ -148,7 +148,7 @@ static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current
148{ 148{
149 while (*current < required) { 149 while (*current < required) {
150 if (bytebuffer_offset >= bytebuffer_size) { 150 if (bytebuffer_offset >= bytebuffer_size) {
151 /* Leave the first 4 bytes empty so we can always unwind the bitbuffer 151 /* Leave the first 4 bytes empty so we can always unwind the bitbuffer
152 * to the front of the bytebuffer, leave 4 bytes free at end of tail 152 * to the front of the bytebuffer, leave 4 bytes free at end of tail
153 * so we can easily top up buffer in check_trailer_gzip() */ 153 * so we can easily top up buffer in check_trailer_gzip() */
154 bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8); 154 bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8);
@@ -193,7 +193,7 @@ static void make_gunzip_crc_table(void)
193/* 193/*
194 * Free the malloc'ed tables built by huft_build(), which makes a linked 194 * Free the malloc'ed tables built by huft_build(), which makes a linked
195 * list of the tables it made, with the links in a dummy first entry of 195 * list of the tables it made, with the links in a dummy first entry of
196 * each table. 196 * each table.
197 * t: table to free 197 * t: table to free
198 */ 198 */
199static int huft_free(huft_t * t) 199static int huft_free(huft_t * t)
@@ -435,9 +435,9 @@ static int inflate_codes(huft_t * my_tl, huft_t * my_td, const unsigned int my_b
435 md = mask_bits[bd]; 435 md = mask_bits[bd];
436 return 0; // Don't actually do anything the first time 436 return 0; // Don't actually do anything the first time
437 } 437 }
438 438
439 if (resumeCopy) goto do_copy; 439 if (resumeCopy) goto do_copy;
440 440
441 while (1) { /* do until end of block */ 441 while (1) { /* do until end of block */
442 b = fill_bitbuffer(b, &k, bl); 442 b = fill_bitbuffer(b, &k, bl);
443 if ((e = (t = tl + ((unsigned) b & ml))->e) > 16) 443 if ((e = (t = tl + ((unsigned) b & ml))->e) > 16)
@@ -533,7 +533,7 @@ do_copy: do {
533 /* free the decoding tables, return */ 533 /* free the decoding tables, return */
534 huft_free(tl); 534 huft_free(tl);
535 huft_free(td); 535 huft_free(td);
536 536
537 /* done */ 537 /* done */
538 return 0; 538 return 0;
539} 539}
@@ -548,7 +548,7 @@ static int inflate_stored(int my_n, int my_b_stored, int my_k_stored, int setup)
548 w = gunzip_outbuf_count; /* initialize gunzip_window position */ 548 w = gunzip_outbuf_count; /* initialize gunzip_window position */
549 return 0; // Don't do anything first time 549 return 0; // Don't do anything first time
550 } 550 }
551 551
552 /* read and output the compressed data */ 552 /* read and output the compressed data */
553 while (n--) { 553 while (n--) {
554 b_stored = fill_bitbuffer(b_stored, &k_stored, 8); 554 b_stored = fill_bitbuffer(b_stored, &k_stored, 8);
@@ -639,7 +639,7 @@ static int inflate_block(int *e)
639 inflate_stored(n, b_stored, k_stored, 1); // Setup inflate_stored 639 inflate_stored(n, b_stored, k_stored, 1); // Setup inflate_stored
640 return -1; 640 return -1;
641 } 641 }
642 case 1: /* Inflate fixed 642 case 1: /* Inflate fixed
643 * decompress an inflated type 1 (fixed Huffman codes) block. We should 643 * decompress an inflated type 1 (fixed Huffman codes) block. We should
644 * either replace this with a custom decoder, or at least precompute the 644 * either replace this with a custom decoder, or at least precompute the
645 * Huffman tables. 645 * Huffman tables.
@@ -682,9 +682,9 @@ static int inflate_block(int *e)
682 682
683 /* decompress until an end-of-block code */ 683 /* decompress until an end-of-block code */
684 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes 684 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes
685 685
686 /* huft_free code moved into inflate_codes */ 686 /* huft_free code moved into inflate_codes */
687 687
688 return -2; 688 return -2;
689 } 689 }
690 case 2: /* Inflate dynamic */ 690 case 2: /* Inflate dynamic */
@@ -836,7 +836,7 @@ static int inflate_block(int *e)
836 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes 836 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes
837 837
838 /* huft_free code moved into inflate_codes */ 838 /* huft_free code moved into inflate_codes */
839 839
840 return -2; 840 return -2;
841 } 841 }
842 default: 842 default:
@@ -859,12 +859,12 @@ static int inflate_get_next_window(void)
859 static int method = -1; // Method == -1 for stored, -2 for codes 859 static int method = -1; // Method == -1 for stored, -2 for codes
860 static int e = 0; 860 static int e = 0;
861 static int needAnotherBlock = 1; 861 static int needAnotherBlock = 1;
862 862
863 gunzip_outbuf_count = 0; 863 gunzip_outbuf_count = 0;
864 864
865 while(1) { 865 while(1) {
866 int ret; 866 int ret;
867 867
868 if (needAnotherBlock) { 868 if (needAnotherBlock) {
869 if(e) { 869 if(e) {
870 calculate_gunzip_crc(); 870 calculate_gunzip_crc();
@@ -875,7 +875,7 @@ static int inflate_get_next_window(void)
875 method = inflate_block(&e); 875 method = inflate_block(&e);
876 needAnotherBlock = 0; 876 needAnotherBlock = 0;
877 } 877 }
878 878
879 switch (method) { 879 switch (method) {
880 case -1: ret = inflate_stored(0,0,0,0); 880 case -1: ret = inflate_stored(0,0,0,0);
881 break; 881 break;
@@ -920,7 +920,7 @@ extern int inflate_unzip(int in, int out)
920 make_gunzip_crc_table(); 920 make_gunzip_crc_table();
921 921
922 /* Allocate space for buffer */ 922 /* Allocate space for buffer */
923 bytebuffer = xmalloc(bytebuffer_max); 923 bytebuffer = xmalloc(bytebuffer_max);
924 924
925 while(1) { 925 while(1) {
926 int ret = inflate_get_next_window(); 926 int ret = inflate_get_next_window();
@@ -977,6 +977,6 @@ extern int inflate_gunzip(int in, int out)
977 (bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) { 977 (bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
978 bb_error_msg("Incorrect length"); 978 bb_error_msg("Incorrect length");
979 } 979 }
980 980
981 return 0; 981 return 0;
982} 982}
diff --git a/archival/libunarchive/filter_accept_list_reassign.c b/archival/libunarchive/filter_accept_list_reassign.c
index 1e9da0f2b..d0436549b 100644
--- a/archival/libunarchive/filter_accept_list_reassign.c
+++ b/archival/libunarchive/filter_accept_list_reassign.c
@@ -26,7 +26,7 @@
26/* 26/*
27 * Reassign the subarchive metadata parser based on the filename extension 27 * Reassign the subarchive metadata parser based on the filename extension
28 * e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz 28 * e.g. if its a .tar.gz modify archive_handle->sub_archive to process a .tar.gz
29 * or if its a .tar.bz2 make archive_handle->sub_archive handle that 29 * or if its a .tar.bz2 make archive_handle->sub_archive handle that
30 */ 30 */
31extern char filter_accept_list_reassign(archive_handle_t *archive_handle) 31extern char filter_accept_list_reassign(archive_handle_t *archive_handle)
32{ 32{
diff --git a/archival/libunarchive/get_header_ar.c b/archival/libunarchive/get_header_ar.c
index 25eafe0bd..86e0bc08f 100644
--- a/archival/libunarchive/get_header_ar.c
+++ b/archival/libunarchive/get_header_ar.c
@@ -113,7 +113,7 @@ extern char get_header_ar(archive_handle_t *archive_handle)
113 archive_handle->action_data(archive_handle); 113 archive_handle->action_data(archive_handle);
114 } 114 }
115 } else { 115 } else {
116 data_skip(archive_handle); 116 data_skip(archive_handle);
117 } 117 }
118 118
119 archive_handle->offset += typed->size; 119 archive_handle->offset += typed->size;
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c
index 25fdc0600..e8a68f1c3 100644
--- a/archival/libunarchive/get_header_cpio.c
+++ b/archival/libunarchive/get_header_cpio.c
@@ -36,7 +36,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
36 int namesize; 36 int namesize;
37 char dummy[16]; 37 char dummy[16];
38 int major, minor, nlink, inode; 38 int major, minor, nlink, inode;
39 39
40 if (pending_hardlinks) { /* Deal with any pending hardlinks */ 40 if (pending_hardlinks) { /* Deal with any pending hardlinks */
41 hardlinks_t *tmp; 41 hardlinks_t *tmp;
42 hardlinks_t *oldtmp; 42 hardlinks_t *oldtmp;
@@ -77,7 +77,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
77 { 77 {
78 unsigned long tmpsize; 78 unsigned long tmpsize;
79 sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c", 79 sscanf(cpio_header, "%6c%8x%8x%8x%8x%8x%8lx%8lx%16c%8x%8x%8x%8c",
80 dummy, &inode, (unsigned int*)&file_header->mode, 80 dummy, &inode, (unsigned int*)&file_header->mode,
81 (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid, 81 (unsigned int*)&file_header->uid, (unsigned int*)&file_header->gid,
82 &nlink, &file_header->mtime, &tmpsize, 82 &nlink, &file_header->mtime, &tmpsize,
83 dummy, &major, &minor, &namesize, dummy); 83 dummy, &major, &minor, &namesize, dummy);
@@ -147,7 +147,7 @@ extern char get_header_cpio(archive_handle_t *archive_handle)
147 archive_handle->action_data(archive_handle); 147 archive_handle->action_data(archive_handle);
148 archive_handle->action_header(archive_handle->file_header); 148 archive_handle->action_header(archive_handle->file_header);
149 } else { 149 } else {
150 data_skip(archive_handle); 150 data_skip(archive_handle);
151 } 151 }
152 152
153 archive_handle->offset += file_header->size; 153 archive_handle->offset += file_header->size;
diff --git a/archival/libunarchive/get_header_tar.c b/archival/libunarchive/get_header_tar.c
index ad580617b..c6ebdae80 100644
--- a/archival/libunarchive/get_header_tar.c
+++ b/archival/libunarchive/get_header_tar.c
@@ -119,7 +119,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
119 file_header->gid = strtol(tar.formated.gid, NULL, 8); 119 file_header->gid = strtol(tar.formated.gid, NULL, 8);
120 file_header->size = strtol(tar.formated.size, NULL, 8); 120 file_header->size = strtol(tar.formated.size, NULL, 8);
121 file_header->mtime = strtol(tar.formated.mtime, NULL, 8); 121 file_header->mtime = strtol(tar.formated.mtime, NULL, 8);
122 file_header->link_name = (tar.formated.linkname[0] != '\0') ? 122 file_header->link_name = (tar.formated.linkname[0] != '\0') ?
123 bb_xstrdup(tar.formated.linkname) : NULL; 123 bb_xstrdup(tar.formated.linkname) : NULL;
124 file_header->device = (dev_t) ((strtol(tar.formated.devmajor, NULL, 8) << 8) + 124 file_header->device = (dev_t) ((strtol(tar.formated.devmajor, NULL, 8) << 8) +
125 strtol(tar.formated.devminor, NULL, 8)); 125 strtol(tar.formated.devminor, NULL, 8));
@@ -205,7 +205,7 @@ extern char get_header_tar(archive_handle_t *archive_handle)
205 archive_handle->action_data(archive_handle); 205 archive_handle->action_data(archive_handle);
206 archive_handle->passed = llist_add_to(archive_handle->passed, file_header->name); 206 archive_handle->passed = llist_add_to(archive_handle->passed, file_header->name);
207 } else { 207 } else {
208 data_skip(archive_handle); 208 data_skip(archive_handle);
209 } 209 }
210 archive_handle->offset += file_header->size; 210 archive_handle->offset += file_header->size;
211 211
diff --git a/archival/libunarchive/uncompress.c b/archival/libunarchive/uncompress.c
index 65418a7ca..ddf293fd6 100644
--- a/archival/libunarchive/uncompress.c
+++ b/archival/libunarchive/uncompress.c
@@ -3,7 +3,7 @@
3 3
4/* uncompress for busybox -- (c) 2002 Robert Griebl 4/* uncompress for busybox -- (c) 2002 Robert Griebl
5 * 5 *
6 * based on the original compress42.c source 6 * based on the original compress42.c source
7 * (see disclaimer below) 7 * (see disclaimer below)
8 */ 8 */
9 9
diff --git a/archival/libunarchive/unzip.c b/archival/libunarchive/unzip.c
index 29929c282..a436db191 100644
--- a/archival/libunarchive/unzip.c
+++ b/archival/libunarchive/unzip.c
@@ -13,7 +13,7 @@
13 * 13 *
14 * General cleanup to better adhere to the style guide and make use of standard 14 * General cleanup to better adhere to the style guide and make use of standard
15 * busybox functions by Glenn McGrath <bug1@optushome.com.au> 15 * busybox functions by Glenn McGrath <bug1@optushome.com.au>
16 * 16 *
17 * read_gz interface + associated hacking by Laurence Anderson 17 * read_gz interface + associated hacking by Laurence Anderson
18 * 18 *
19 * This program is free software; you can redistribute it and/or modify 19 * This program is free software; you can redistribute it and/or modify
@@ -148,7 +148,7 @@ static unsigned int fill_bitbuffer(unsigned int bitbuffer, unsigned int *current
148{ 148{
149 while (*current < required) { 149 while (*current < required) {
150 if (bytebuffer_offset >= bytebuffer_size) { 150 if (bytebuffer_offset >= bytebuffer_size) {
151 /* Leave the first 4 bytes empty so we can always unwind the bitbuffer 151 /* Leave the first 4 bytes empty so we can always unwind the bitbuffer
152 * to the front of the bytebuffer, leave 4 bytes free at end of tail 152 * to the front of the bytebuffer, leave 4 bytes free at end of tail
153 * so we can easily top up buffer in check_trailer_gzip() */ 153 * so we can easily top up buffer in check_trailer_gzip() */
154 bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8); 154 bytebuffer_size = 4 + bb_xread(gunzip_src_fd, &bytebuffer[4], bytebuffer_max - 8);
@@ -193,7 +193,7 @@ static void make_gunzip_crc_table(void)
193/* 193/*
194 * Free the malloc'ed tables built by huft_build(), which makes a linked 194 * Free the malloc'ed tables built by huft_build(), which makes a linked
195 * list of the tables it made, with the links in a dummy first entry of 195 * list of the tables it made, with the links in a dummy first entry of
196 * each table. 196 * each table.
197 * t: table to free 197 * t: table to free
198 */ 198 */
199static int huft_free(huft_t * t) 199static int huft_free(huft_t * t)
@@ -435,9 +435,9 @@ static int inflate_codes(huft_t * my_tl, huft_t * my_td, const unsigned int my_b
435 md = mask_bits[bd]; 435 md = mask_bits[bd];
436 return 0; // Don't actually do anything the first time 436 return 0; // Don't actually do anything the first time
437 } 437 }
438 438
439 if (resumeCopy) goto do_copy; 439 if (resumeCopy) goto do_copy;
440 440
441 while (1) { /* do until end of block */ 441 while (1) { /* do until end of block */
442 b = fill_bitbuffer(b, &k, bl); 442 b = fill_bitbuffer(b, &k, bl);
443 if ((e = (t = tl + ((unsigned) b & ml))->e) > 16) 443 if ((e = (t = tl + ((unsigned) b & ml))->e) > 16)
@@ -533,7 +533,7 @@ do_copy: do {
533 /* free the decoding tables, return */ 533 /* free the decoding tables, return */
534 huft_free(tl); 534 huft_free(tl);
535 huft_free(td); 535 huft_free(td);
536 536
537 /* done */ 537 /* done */
538 return 0; 538 return 0;
539} 539}
@@ -548,7 +548,7 @@ static int inflate_stored(int my_n, int my_b_stored, int my_k_stored, int setup)
548 w = gunzip_outbuf_count; /* initialize gunzip_window position */ 548 w = gunzip_outbuf_count; /* initialize gunzip_window position */
549 return 0; // Don't do anything first time 549 return 0; // Don't do anything first time
550 } 550 }
551 551
552 /* read and output the compressed data */ 552 /* read and output the compressed data */
553 while (n--) { 553 while (n--) {
554 b_stored = fill_bitbuffer(b_stored, &k_stored, 8); 554 b_stored = fill_bitbuffer(b_stored, &k_stored, 8);
@@ -639,7 +639,7 @@ static int inflate_block(int *e)
639 inflate_stored(n, b_stored, k_stored, 1); // Setup inflate_stored 639 inflate_stored(n, b_stored, k_stored, 1); // Setup inflate_stored
640 return -1; 640 return -1;
641 } 641 }
642 case 1: /* Inflate fixed 642 case 1: /* Inflate fixed
643 * decompress an inflated type 1 (fixed Huffman codes) block. We should 643 * decompress an inflated type 1 (fixed Huffman codes) block. We should
644 * either replace this with a custom decoder, or at least precompute the 644 * either replace this with a custom decoder, or at least precompute the
645 * Huffman tables. 645 * Huffman tables.
@@ -682,9 +682,9 @@ static int inflate_block(int *e)
682 682
683 /* decompress until an end-of-block code */ 683 /* decompress until an end-of-block code */
684 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes 684 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes
685 685
686 /* huft_free code moved into inflate_codes */ 686 /* huft_free code moved into inflate_codes */
687 687
688 return -2; 688 return -2;
689 } 689 }
690 case 2: /* Inflate dynamic */ 690 case 2: /* Inflate dynamic */
@@ -836,7 +836,7 @@ static int inflate_block(int *e)
836 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes 836 inflate_codes(tl, td, bl, bd, 1); // Setup inflate_codes
837 837
838 /* huft_free code moved into inflate_codes */ 838 /* huft_free code moved into inflate_codes */
839 839
840 return -2; 840 return -2;
841 } 841 }
842 default: 842 default:
@@ -859,12 +859,12 @@ static int inflate_get_next_window(void)
859 static int method = -1; // Method == -1 for stored, -2 for codes 859 static int method = -1; // Method == -1 for stored, -2 for codes
860 static int e = 0; 860 static int e = 0;
861 static int needAnotherBlock = 1; 861 static int needAnotherBlock = 1;
862 862
863 gunzip_outbuf_count = 0; 863 gunzip_outbuf_count = 0;
864 864
865 while(1) { 865 while(1) {
866 int ret; 866 int ret;
867 867
868 if (needAnotherBlock) { 868 if (needAnotherBlock) {
869 if(e) { 869 if(e) {
870 calculate_gunzip_crc(); 870 calculate_gunzip_crc();
@@ -875,7 +875,7 @@ static int inflate_get_next_window(void)
875 method = inflate_block(&e); 875 method = inflate_block(&e);
876 needAnotherBlock = 0; 876 needAnotherBlock = 0;
877 } 877 }
878 878
879 switch (method) { 879 switch (method) {
880 case -1: ret = inflate_stored(0,0,0,0); 880 case -1: ret = inflate_stored(0,0,0,0);
881 break; 881 break;
@@ -920,7 +920,7 @@ extern int inflate_unzip(int in, int out)
920 make_gunzip_crc_table(); 920 make_gunzip_crc_table();
921 921
922 /* Allocate space for buffer */ 922 /* Allocate space for buffer */
923 bytebuffer = xmalloc(bytebuffer_max); 923 bytebuffer = xmalloc(bytebuffer_max);
924 924
925 while(1) { 925 while(1) {
926 int ret = inflate_get_next_window(); 926 int ret = inflate_get_next_window();
@@ -977,6 +977,6 @@ extern int inflate_gunzip(int in, int out)
977 (bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) { 977 (bytebuffer[bytebuffer_offset+2] << 16) | (bytebuffer[bytebuffer_offset+3] << 24))) {
978 bb_error_msg("Incorrect length"); 978 bb_error_msg("Incorrect length");
979 } 979 }
980 980
981 return 0; 981 return 0;
982} 982}
diff --git a/archival/rpm.c b/archival/rpm.c
index eb2c0433b..30cdc93fb 100644
--- a/archival/rpm.c
+++ b/archival/rpm.c
@@ -204,12 +204,12 @@ void extract_cpio_gz(int fd) {
204 archive_handle->flags |= ARCHIVE_CREATE_LEADING_DIRS; 204 archive_handle->flags |= ARCHIVE_CREATE_LEADING_DIRS;
205 archive_handle->src_fd = fd; 205 archive_handle->src_fd = fd;
206 archive_handle->offset = 0; 206 archive_handle->offset = 0;
207 207
208 bb_xread_all(archive_handle->src_fd, &magic, 2); 208 bb_xread_all(archive_handle->src_fd, &magic, 2);
209 if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) { 209 if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
210 bb_error_msg_and_die("Invalid gzip magic"); 210 bb_error_msg_and_die("Invalid gzip magic");
211 } 211 }
212 check_header_gzip(archive_handle->src_fd); 212 check_header_gzip(archive_handle->src_fd);
213 chdir("/"); // Install RPM's to root 213 chdir("/"); // Install RPM's to root
214 214
215 archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip); 215 archive_handle->src_fd = open_transformer(archive_handle->src_fd, inflate_gunzip);
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c
index d0041a83c..7b5059518 100644
--- a/archival/rpm2cpio.c
+++ b/archival/rpm2cpio.c
@@ -89,7 +89,7 @@ extern int rpm2cpio_main(int argc, char **argv)
89 89
90 /* Skip the main header */ 90 /* Skip the main header */
91 skip_header(rpm_fd); 91 skip_header(rpm_fd);
92 92
93 bb_xread_all(rpm_fd, &magic, 2); 93 bb_xread_all(rpm_fd, &magic, 2);
94 if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) { 94 if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
95 bb_error_msg_and_die("Invalid gzip magic"); 95 bb_error_msg_and_die("Invalid gzip magic");
diff --git a/archival/tar.c b/archival/tar.c
index cbd069425..2310e80cb 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Mini tar implementation for busybox 3 * Mini tar implementation for busybox
4 * 4 *
5 * Modifed to use common extraction code used by ar, cpio, dpkg-deb, dpkg 5 * Modifed to use common extraction code used by ar, cpio, dpkg-deb, dpkg
6 * Glenn McGrath <bug1@optushome.com.au> 6 * Glenn McGrath <bug1@optushome.com.au>
@@ -9,7 +9,7 @@
9 * ground up. It still has remnents of the old code lying about, but it is 9 * ground up. It still has remnents of the old code lying about, but it is
10 * very different now (i.e., cleaner, less global variables, etc.) 10 * very different now (i.e., cleaner, less global variables, etc.)
11 * 11 *
12 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 12 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
13 * 13 *
14 * Based in part in the tar implementation in sash 14 * Based in part in the tar implementation in sash
15 * Copyright (c) 1999 by David I. Bell 15 * Copyright (c) 1999 by David I. Bell
@@ -111,7 +111,7 @@ struct TarBallInfo {
111 for the tarball */ 111 for the tarball */
112 struct stat statBuf; /* Stat info for the tarball, letting 112 struct stat statBuf; /* Stat info for the tarball, letting
113 us know the inode and device that the 113 us know the inode and device that the
114 tarball lives, so we can avoid trying 114 tarball lives, so we can avoid trying
115 to include the tarball into itself */ 115 to include the tarball into itself */
116 int verboseFlag; /* Whether to print extra stuff or not */ 116 int verboseFlag; /* Whether to print extra stuff or not */
117 const llist_t *excludeList; /* List of files to not include */ 117 const llist_t *excludeList; /* List of files to not include */
@@ -470,7 +470,7 @@ static inline int writeTarFile(const int tar_fd, const int verboseFlag,
470 (void) &include; 470 (void) &include;
471 (void) &errorFlag; 471 (void) &errorFlag;
472# endif 472# endif
473 473
474 gzipPid = vfork(); 474 gzipPid = vfork();
475 475
476 if (gzipPid == 0) { 476 if (gzipPid == 0) {
@@ -616,7 +616,7 @@ static char get_header_tar_Z(archive_handle_t *archive_handle)
616#endif 616#endif
617 617
618#ifdef CONFIG_FEATURE_TAR_BZIP2 618#ifdef CONFIG_FEATURE_TAR_BZIP2
619# define TAR_OPT_BZIP2 (1 << (8 + TAR_OPT_FLAG_CREATE)) 619# define TAR_OPT_BZIP2 (1 << (8 + TAR_OPT_FLAG_CREATE))
620# define TAR_OPT_STR_BZIP2 "j" 620# define TAR_OPT_STR_BZIP2 "j"
621# define TAR_OPT_FLAG_BZIP2 1 621# define TAR_OPT_FLAG_BZIP2 1
622#else 622#else
@@ -646,7 +646,7 @@ static char get_header_tar_Z(archive_handle_t *archive_handle)
646#ifdef CONFIG_FEATURE_TAR_COMPRESS 646#ifdef CONFIG_FEATURE_TAR_COMPRESS
647# define TAR_OPT_UNCOMPRESS (1 << (8 + TAR_OPT_FLAG_CREATE + TAR_OPT_FLAG_BZIP2 + TAR_OPT_FLAG_FROM + TAR_OPT_FLAG_GZIP)) 647# define TAR_OPT_UNCOMPRESS (1 << (8 + TAR_OPT_FLAG_CREATE + TAR_OPT_FLAG_BZIP2 + TAR_OPT_FLAG_FROM + TAR_OPT_FLAG_GZIP))
648# define TAR_OPT_STR_COMPRESS "Z" 648# define TAR_OPT_STR_COMPRESS "Z"
649#else 649#else
650# define TAR_OPT_STR_COMPRESS "" 650# define TAR_OPT_STR_COMPRESS ""
651#endif 651#endif
652 652
@@ -740,7 +740,7 @@ int tar_main(int argc, char **argv)
740 bb_show_usage(); 740 bb_show_usage();
741 } 741 }
742 if(ctx_flag & CTX_TEST) { 742 if(ctx_flag & CTX_TEST) {
743 if ((tar_handle->action_header == header_list) || 743 if ((tar_handle->action_header == header_list) ||
744 (tar_handle->action_header == header_verbose_list)) { 744 (tar_handle->action_header == header_verbose_list)) {
745 tar_handle->action_header = header_verbose_list; 745 tar_handle->action_header = header_verbose_list;
746 } else { 746 } else {
@@ -756,8 +756,8 @@ int tar_main(int argc, char **argv)
756 tar_handle->action_data = data_extract_to_stdout; 756 tar_handle->action_data = data_extract_to_stdout;
757 } 757 }
758 if(opt & TAR_OPT_VERBOSE) { 758 if(opt & TAR_OPT_VERBOSE) {
759 if ((tar_handle->action_header == header_list) || 759 if ((tar_handle->action_header == header_list) ||
760 (tar_handle->action_header == header_verbose_list)) 760 (tar_handle->action_header == header_verbose_list))
761 { 761 {
762 tar_handle->action_header = header_verbose_list; 762 tar_handle->action_header = header_verbose_list;
763 } else { 763 } else {
@@ -860,13 +860,13 @@ int tar_main(int argc, char **argv)
860 } 860 }
861# endif /* CONFIG_FEATURE_TAR_BZIP2 */ 861# endif /* CONFIG_FEATURE_TAR_BZIP2 */
862 862
863 if ((tar_handle->action_header == header_list) || 863 if ((tar_handle->action_header == header_list) ||
864 (tar_handle->action_header == header_verbose_list)) { 864 (tar_handle->action_header == header_verbose_list)) {
865 verboseFlag = TRUE; 865 verboseFlag = TRUE;
866 } 866 }
867 writeTarFile(tar_handle->src_fd, verboseFlag, opt & TAR_OPT_DEREFERNCE, tar_handle->accept, 867 writeTarFile(tar_handle->src_fd, verboseFlag, opt & TAR_OPT_DEREFERNCE, tar_handle->accept,
868 tar_handle->reject, gzipFlag); 868 tar_handle->reject, gzipFlag);
869 } else 869 } else
870#endif /* CONFIG_FEATURE_TAR_CREATE */ 870#endif /* CONFIG_FEATURE_TAR_CREATE */
871 { 871 {
872 while (get_header_ptr(tar_handle) == EXIT_SUCCESS); 872 while (get_header_ptr(tar_handle) == EXIT_SUCCESS);
diff --git a/console-tools/Makefile b/console-tools/Makefile
index d54c778d4..2ee51a5e6 100644
--- a/console-tools/Makefile
+++ b/console-tools/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/console-tools/Makefile.in b/console-tools/Makefile.in
index 032b194f6..1d756c721 100644
--- a/console-tools/Makefile.in
+++ b/console-tools/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index 8ea062cde..3398892f5 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini chvt implementation for busybox 3 * Mini chvt implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/console-tools/clear.c b/console-tools/clear.c
index 45976e1b5..e43ed0e02 100644
--- a/console-tools/clear.c
+++ b/console-tools/clear.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini clear implementation for busybox 3 * Mini clear implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index 363ecdf12..08a9d2122 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -3,13 +3,13 @@
3 * Disallocate virtual terminal(s) 3 * Disallocate virtual terminal(s)
4 * 4 *
5 * Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it> 5 * Copyright (C) 2003 by Tito Ragusa <farmatito@tiscali.it>
6 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
12 * 12 *
13 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index 19ba77d82..6085a446b 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -56,7 +56,7 @@ int dumpkmap_main(int argc, char **argv)
56 write(1, magic, 7); 56 write(1, magic, 7);
57 57
58 for (i=0; i < MAX_NR_KEYMAPS; i++) flags[i]=0; 58 for (i=0; i < MAX_NR_KEYMAPS; i++) flags[i]=0;
59 flags[0]=1; 59 flags[0]=1;
60 flags[1]=1; 60 flags[1]=1;
61 flags[2]=1; 61 flags[2]=1;
62 flags[4]=1; 62 flags[4]=1;
@@ -66,9 +66,9 @@ int dumpkmap_main(int argc, char **argv)
66 flags[9]=1; 66 flags[9]=1;
67 flags[10]=1; 67 flags[10]=1;
68 flags[12]=1; 68 flags[12]=1;
69 69
70 /* dump flags */ 70 /* dump flags */
71 for (i=0; i < MAX_NR_KEYMAPS; i++) write(1,&flags[i],1); 71 for (i=0; i < MAX_NR_KEYMAPS; i++) write(1,&flags[i],1);
72 72
73 for (i = 0; i < MAX_NR_KEYMAPS; i++) { 73 for (i = 0; i < MAX_NR_KEYMAPS; i++) {
74 if (flags[i] == 1) { 74 if (flags[i] == 1) {
@@ -76,13 +76,13 @@ int dumpkmap_main(int argc, char **argv)
76 ke.kb_index = j; 76 ke.kb_index = j;
77 ke.kb_table = i; 77 ke.kb_table = i;
78 if (ioctl(fd, KDGKBENT, &ke) < 0) { 78 if (ioctl(fd, KDGKBENT, &ke) < 0) {
79 79
80 bb_error_msg("ioctl returned: %m, %s, %s, %xqq", (char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); 80 bb_error_msg("ioctl returned: %m, %s, %s, %xqq", (char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
81 } 81 }
82 else { 82 else {
83 write(1,(void*)&ke.kb_value,2); 83 write(1,(void*)&ke.kb_value,2);
84 } 84 }
85 85
86 } 86 }
87 } 87 }
88 } 88 }
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 5b2f31abc..849d747a6 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -75,7 +75,7 @@ int loadkmap_main(int argc, char **argv)
75 } 75 }
76 } 76 }
77 77
78 /* Don't bother to close files. Exit does that 78 /* Don't bother to close files. Exit does that
79 * automagically, so we can save a few bytes */ 79 * automagically, so we can save a few bytes */
80 /* close(fd); */ 80 /* close(fd); */
81 return EXIT_SUCCESS; 81 return EXIT_SUCCESS;
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index b0db33b33..5f244579c 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -56,7 +56,7 @@ int openvt_main(int argc, char **argv)
56 if (setsid() < 0) { 56 if (setsid() < 0) {
57#endif 57#endif
58 58
59 bb_perror_msg_and_die("Unable to set new session"); 59 bb_perror_msg_and_die("Unable to set new session");
60 } 60 }
61 close(0); /* so that new vt becomes stdin */ 61 close(0); /* so that new vt becomes stdin */
62 62
diff --git a/console-tools/reset.c b/console-tools/reset.c
index 3f9ae984d..9d38e7a28 100644
--- a/console-tools/reset.c
+++ b/console-tools/reset.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini reset implementation for busybox 3 * Mini reset implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * Written by Erik Andersen and Kent Robotti <robotti@metconnect.com> 6 * Written by Erik Andersen and Kent Robotti <robotti@metconnect.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index 0a5366be9..169d0bb0a 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -35,7 +35,7 @@ struct kbkeycode {
35}; 35};
36static const int KDSETKEYCODE = 0x4B4D; /* write kernel keycode table entry */ 36static const int KDSETKEYCODE = 0x4B4D; /* write kernel keycode table entry */
37 37
38extern int 38extern int
39setkeycodes_main(int argc, char** argv) 39setkeycodes_main(int argc, char** argv)
40{ 40{
41 char *ep; 41 char *ep;
@@ -45,7 +45,7 @@ setkeycodes_main(int argc, char** argv)
45 if (argc % 2 != 1 || argc < 2) { 45 if (argc % 2 != 1 || argc < 2) {
46 bb_show_usage(); 46 bb_show_usage();
47 } 47 }
48 48
49 fd = get_console_fd(); 49 fd = get_console_fd();
50 50
51 while (argc > 2) { 51 while (argc > 2) {
diff --git a/coreutils/Config.in b/coreutils/Config.in
index 900908a9e..5c0180a5e 100644
--- a/coreutils/Config.in
+++ b/coreutils/Config.in
@@ -10,7 +10,7 @@ config CONFIG_BASENAME
10 default n 10 default n
11 help 11 help
12 basename is used to strip the directory and suffix from filenames, 12 basename is used to strip the directory and suffix from filenames,
13 leaving just the filename itself. Enable this option if you wish 13 leaving just the filename itself. Enable this option if you wish
14 to enable the 'basename' utility. 14 to enable the 'basename' utility.
15 15
16config CONFIG_CAL 16config CONFIG_CAL
@@ -101,7 +101,7 @@ config CONFIG_DD
101 help 101 help
102 dd copies a file (from standard input to standard output, 102 dd copies a file (from standard input to standard output,
103 by default) using specific input and output blocksizes, 103 by default) using specific input and output blocksizes,
104 while optionally performing conversions on it. 104 while optionally performing conversions on it.
105 105
106config CONFIG_DF 106config CONFIG_DF
107 bool "df" 107 bool "df"
@@ -154,7 +154,7 @@ config CONFIG_FEATURE_FANCY_ECHO
154 default y 154 default y
155 depends on CONFIG_ECHO 155 depends on CONFIG_ECHO
156 help 156 help
157 This adds options (-n and -e) to echo. 157 This adds options (-n and -e) to echo.
158 158
159config CONFIG_ENV 159config CONFIG_ENV
160 bool "env" 160 bool "env"
diff --git a/coreutils/Makefile b/coreutils/Makefile
index a5cdf6248..b42689a26 100644
--- a/coreutils/Makefile
+++ b/coreutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/coreutils/Makefile.in b/coreutils/Makefile.in
index 6c2547648..a5343c9c7 100644
--- a/coreutils/Makefile.in
+++ b/coreutils/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/coreutils/basename.c b/coreutils/basename.c
index 7fcdb8368..7b8b7b6f0 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini basename implementation for busybox 3 * Mini basename implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/cal.c b/coreutils/cal.c
index 786156253..cd7be0d30 100644
--- a/coreutils/cal.c
+++ b/coreutils/cal.c
@@ -161,7 +161,7 @@ int cal_main(int argc, char **argv)
161 int row, len, days[MAXDAYS]; 161 int row, len, days[MAXDAYS];
162 int *dp = days; 162 int *dp = days;
163 char lineout[30]; 163 char lineout[30];
164 164
165 day_array(month, year, dp); 165 day_array(month, year, dp);
166 len = sprintf(lineout, "%s %d", month_names[month - 1], year); 166 len = sprintf(lineout, "%s %d", month_names[month - 1], year);
167 bb_printf("%*s%s\n%s\n", 167 bb_printf("%*s%s\n%s\n",
@@ -176,7 +176,7 @@ int cal_main(int argc, char **argv)
176 int row, which_cal, week_len, days[12][MAXDAYS]; 176 int row, which_cal, week_len, days[12][MAXDAYS];
177 int *dp; 177 int *dp;
178 char lineout[80]; 178 char lineout[80];
179 179
180 sprintf(lineout, "%d", year); 180 sprintf(lineout, "%d", year);
181 center(lineout, 181 center(lineout,
182 (WEEK_LEN * 3 + HEAD_SEP * 2) 182 (WEEK_LEN * 3 + HEAD_SEP * 2)
@@ -317,7 +317,7 @@ static void blank_string(char *buf, size_t buflen)
317static char *build_row(char *p, int *dp) 317static char *build_row(char *p, int *dp)
318{ 318{
319 int col, val, day; 319 int col, val, day;
320 320
321 memset(p, ' ', (julian + DAY_LEN) * 7); 321 memset(p, ' ', (julian + DAY_LEN) * 7);
322 322
323 col = 0; 323 col = 0;
diff --git a/coreutils/chgrp.c b/coreutils/chgrp.c
index 93e493869..8cfb54241 100644
--- a/coreutils/chgrp.c
+++ b/coreutils/chgrp.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini chgrp implementation for busybox 3 * Mini chgrp implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -63,7 +63,7 @@ int chgrp_main(int argc, char **argv)
63 63
64 /* Ok, ready to do the deed now */ 64 /* Ok, ready to do the deed now */
65 do { 65 do {
66 if (! recursive_action (*argv, recursiveFlag, FALSE, FALSE, 66 if (! recursive_action (*argv, recursiveFlag, FALSE, FALSE,
67 fileAction, fileAction, &gid)) { 67 fileAction, fileAction, &gid)) {
68 retval = EXIT_FAILURE; 68 retval = EXIT_FAILURE;
69 } 69 }
diff --git a/coreutils/chmod.c b/coreutils/chmod.c
index 390cc6d2c..0cb888628 100644
--- a/coreutils/chmod.c
+++ b/coreutils/chmod.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini chmod implementation for busybox 3 * Mini chmod implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Reworked by (C) 2002 Vladimir Oleynik <dzo@simtreas.ru> 7 * Reworked by (C) 2002 Vladimir Oleynik <dzo@simtreas.ru>
8 * to correctly parse '-rwxgoa' 8 * to correctly parse '-rwxgoa'
diff --git a/coreutils/chown.c b/coreutils/chown.c
index 07d673f28..638745f17 100644
--- a/coreutils/chown.c
+++ b/coreutils/chown.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini chown implementation for busybox 3 * Mini chown implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -84,10 +84,10 @@ int chown_main(int argc, char **argv)
84 uid = get_ug_id(*argv, my_getpwnam); 84 uid = get_ug_id(*argv, my_getpwnam);
85 85
86 ++argv; 86 ++argv;
87 87
88 /* Ok, ready to do the deed now */ 88 /* Ok, ready to do the deed now */
89 do { 89 do {
90 if (! recursive_action (*argv, (flags & FLAG_R), FALSE, FALSE, 90 if (! recursive_action (*argv, (flags & FLAG_R), FALSE, FALSE,
91 fileAction, fileAction, NULL)) { 91 fileAction, fileAction, NULL)) {
92 retval = EXIT_FAILURE; 92 retval = EXIT_FAILURE;
93 } 93 }
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index eeed01302..62257021d 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini chroot implementation for busybox 3 * Mini chroot implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 34ec3690c..d9f8161f3 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -3,7 +3,7 @@
3 * cut.c - minimalist version of cut 3 * cut.c - minimalist version of cut
4 * 4 *
5 * Copyright (C) 1999,2000,2001 by Lineo, inc. 5 * Copyright (C) 1999,2000,2001 by Lineo, inc.
6 * Written by Mark Whitley <markw@lineo.com>, <markw@codepoet.org> 6 * Written by Mark Whitley <markw@codepoet.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ static int cmpfunc(const void *a, const void *b)
69 69
70/* 70/*
71 * parse_lists() - parses a list and puts values into startpos and endpos. 71 * parse_lists() - parses a list and puts values into startpos and endpos.
72 * valid list formats: N, N-, N-M, -M 72 * valid list formats: N, N-, N-M, -M
73 * more than one list can be seperated by commas 73 * more than one list can be seperated by commas
74 */ 74 */
75static void parse_lists(char *lists) 75static void parse_lists(char *lists)
@@ -96,7 +96,7 @@ static void parse_lists(char *lists)
96 s = strtoul(ntok, &junk, 10); 96 s = strtoul(ntok, &junk, 10);
97 if(*junk != '\0' || s < 0) 97 if(*junk != '\0' || s < 0)
98 bb_error_msg_and_die("invalid byte or field list"); 98 bb_error_msg_and_die("invalid byte or field list");
99 99
100 /* account for the fact that arrays are zero based, while the user 100 /* account for the fact that arrays are zero based, while the user
101 * expects the first char on the line to be char # 1 */ 101 * expects the first char on the line to be char # 1 */
102 if (s != 0) 102 if (s != 0)
@@ -125,7 +125,7 @@ static void parse_lists(char *lists)
125 /* if there's something left to tokenize, the user past an invalid list */ 125 /* if there's something left to tokenize, the user past an invalid list */
126 if (ltok) 126 if (ltok)
127 bb_error_msg_and_die("invalid byte or field list"); 127 bb_error_msg_and_die("invalid byte or field list");
128 128
129 /* add the new list */ 129 /* add the new list */
130 cut_lists = xrealloc(cut_lists, sizeof(struct cut_list) * (++nlists)); 130 cut_lists = xrealloc(cut_lists, sizeof(struct cut_list) * (++nlists));
131 cut_lists[nlists-1].startpos = s; 131 cut_lists[nlists-1].startpos = s;
@@ -227,7 +227,7 @@ static void cut_file_by_lines(const char *line, unsigned int linenum)
227{ 227{
228 static int c = 0; 228 static int c = 0;
229 static int l = -1; 229 static int l = -1;
230 230
231 /* I can't initialize this above cuz the "initializer isn't 231 /* I can't initialize this above cuz the "initializer isn't
232 * constant" *sigh* */ 232 * constant" *sigh* */
233 if (l == -1) 233 if (l == -1)
diff --git a/coreutils/date.c b/coreutils/date.c
index a6b595e57..9c763299f 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -3,7 +3,7 @@
3 * Mini date implementation for busybox 3 * Mini date implementation for busybox
4 * 4 *
5 * by Matthew Grant <grantma@anathoth.gen.nz> 5 * by Matthew Grant <grantma@anathoth.gen.nz>
6 * 6 *
7 * iso-format handling added by Robert Griebl <griebl@gmx.de> 7 * iso-format handling added by Robert Griebl <griebl@gmx.de>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -33,7 +33,7 @@
33#include "busybox.h" 33#include "busybox.h"
34 34
35 35
36/* This 'date' command supports only 2 time setting formats, 36/* This 'date' command supports only 2 time setting formats,
37 all the GNU strftime stuff (its in libc, lets use it), 37 all the GNU strftime stuff (its in libc, lets use it),
38 setting time using UTC and displaying int, as well as 38 setting time using UTC and displaying int, as well as
39 an RFC 822 complient date output for shell scripting 39 an RFC 822 complient date output for shell scripting
diff --git a/coreutils/df.c b/coreutils/df.c
index 9c0d13f62..9d53f2bc4 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini df implementation for busybox 3 * Mini df implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * based on original code by (I think) Bruce Perens <bruce@pixar.com>. 6 * based on original code by (I think) Bruce Perens <bruce@pixar.com>.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
@@ -51,7 +51,7 @@ extern int df_main(int argc, char **argv)
51 long blocks_used; 51 long blocks_used;
52 long blocks_percent_used; 52 long blocks_percent_used;
53#ifdef CONFIG_FEATURE_HUMAN_READABLE 53#ifdef CONFIG_FEATURE_HUMAN_READABLE
54 unsigned long df_disp_hr = KILOBYTE; 54 unsigned long df_disp_hr = KILOBYTE;
55#endif 55#endif
56 int status = EXIT_SUCCESS; 56 int status = EXIT_SUCCESS;
57 unsigned long opt; 57 unsigned long opt;
@@ -115,7 +115,7 @@ extern int df_main(int argc, char **argv)
115 bb_perror_msg("%s", mount_point); 115 bb_perror_msg("%s", mount_point);
116 goto SET_ERROR; 116 goto SET_ERROR;
117 } 117 }
118 118
119 if ((s.f_blocks > 0) || !mount_table){ 119 if ((s.f_blocks > 0) || !mount_table){
120 blocks_used = s.f_blocks - s.f_bfree; 120 blocks_used = s.f_blocks - s.f_bfree;
121 blocks_percent_used = 0; 121 blocks_percent_used = 0;
@@ -124,7 +124,7 @@ extern int df_main(int argc, char **argv)
124 + (blocks_used + s.f_bavail)/2 124 + (blocks_used + s.f_bavail)/2
125 ) / (blocks_used + s.f_bavail); 125 ) / (blocks_used + s.f_bavail);
126 } 126 }
127 127
128 if (strcmp(device, "rootfs") == 0) { 128 if (strcmp(device, "rootfs") == 0) {
129 continue; 129 continue;
130 } else if (strcmp(device, "/dev/root") == 0) { 130 } else if (strcmp(device, "/dev/root") == 0) {
@@ -134,15 +134,15 @@ extern int df_main(int argc, char **argv)
134 goto SET_ERROR; 134 goto SET_ERROR;
135 } 135 }
136 } 136 }
137 137
138#ifdef CONFIG_FEATURE_HUMAN_READABLE 138#ifdef CONFIG_FEATURE_HUMAN_READABLE
139 bb_printf("%-21s%9s ", device, 139 bb_printf("%-21s%9s ", device,
140 make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr)); 140 make_human_readable_str(s.f_blocks, s.f_bsize, df_disp_hr));
141 141
142 bb_printf("%9s ", 142 bb_printf("%9s ",
143 make_human_readable_str( (s.f_blocks - s.f_bfree), 143 make_human_readable_str( (s.f_blocks - s.f_bfree),
144 s.f_bsize, df_disp_hr)); 144 s.f_bsize, df_disp_hr));
145 145
146 bb_printf("%9s %3ld%% %s\n", 146 bb_printf("%9s %3ld%% %s\n",
147 make_human_readable_str(s.f_bavail, s.f_bsize, df_disp_hr), 147 make_human_readable_str(s.f_bavail, s.f_bsize, df_disp_hr),
148 blocks_percent_used, mount_point); 148 blocks_percent_used, mount_point);
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index d0c42b603..5136e4909 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini dirname implementation for busybox 3 * Mini dirname implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index c28e6a8b9..a21ed5bc3 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -50,7 +50,7 @@ typedef unsigned long int bb_uint64_t;
50static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 50static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
51 51
52// if fn is NULL then input is stdin and output is stdout 52// if fn is NULL then input is stdin and output is stdout
53static int convert(char *fn, int ConvType) 53static int convert(char *fn, int ConvType)
54{ 54{
55 int c, fd; 55 int c, fd;
56 struct timeval tv; 56 struct timeval tv;
@@ -156,12 +156,12 @@ static int convert(char *fn, int ConvType)
156 return 0; 156 return 0;
157} 157}
158 158
159int dos2unix_main(int argc, char *argv[]) 159int dos2unix_main(int argc, char *argv[])
160{ 160{
161 int ConvType = CT_AUTO; 161 int ConvType = CT_AUTO;
162 int o; 162 int o;
163 163
164 //See if we are supposed to be doing dos2unix or unix2dos 164 //See if we are supposed to be doing dos2unix or unix2dos
165 if (argv[0][0]=='d') { 165 if (argv[0][0]=='d') {
166 ConvType = CT_DOS2UNIX; 166 ConvType = CT_DOS2UNIX;
167 } 167 }
diff --git a/coreutils/du.c b/coreutils/du.c
index df75a6953..bfa44034a 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -181,7 +181,7 @@ int du_main(int argc, char **argv)
181#else 181#else
182 disp_k = 0; 182 disp_k = 0;
183#endif 183#endif
184 } 184 }
185#endif 185#endif
186 186
187 /* Note: SUSv3 specifies that -a and -s options can not be used together 187 /* Note: SUSv3 specifies that -a and -s options can not be used together
diff --git a/coreutils/echo.c b/coreutils/echo.c
index b600a1fbd..26a6fbf81 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -55,7 +55,7 @@ extern int echo_main(int argc, char** argv)
55 * that all of the options specified are actually valid. 55 * that all of the options specified are actually valid.
56 * Otherwise, the string should just be echoed. 56 * Otherwise, the string should just be echoed.
57 */ 57 */
58 58
59 if (!*(p = *argv + 1)) { /* A single '-', so echo it. */ 59 if (!*(p = *argv + 1)) { /* A single '-', so echo it. */
60 goto just_echo; 60 goto just_echo;
61 } 61 }
@@ -87,7 +87,7 @@ just_echo:
87 while ((c = *(*argv)++)) { 87 while ((c = *(*argv)++)) {
88 if (c == eflag) { /* Check for escape seq. */ 88 if (c == eflag) { /* Check for escape seq. */
89 if (**argv == 'c') { 89 if (**argv == 'c') {
90 /* '\c' means cancel newline and 90 /* '\c' means cancel newline and
91 * ignore all subsequent chars. */ 91 * ignore all subsequent chars. */
92 goto DONE; 92 goto DONE;
93 } 93 }
@@ -141,8 +141,8 @@ DONE:
141 * notice, this list of conditions and the following disclaimer in the 141 * notice, this list of conditions and the following disclaimer in the
142 * documentation and/or other materials provided with the distribution. 142 * documentation and/or other materials provided with the distribution.
143 * 143 *
144 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 144 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
145 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 145 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
146 * 146 *
147 * California, Berkeley and its contributors. 147 * California, Berkeley and its contributors.
148 * 4. Neither the name of the University nor the names of its contributors 148 * 4. Neither the name of the University nor the names of its contributors
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 77d603b88..e5816371a 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -5,7 +5,7 @@
5 * based on GNU expr Mike Parker. 5 * based on GNU expr Mike Parker.
6 * Copyright (C) 86, 1991-1997, 1999 Free Software Foundation, Inc. 6 * Copyright (C) 86, 1991-1997, 1999 Free Software Foundation, Inc.
7 * 7 *
8 * Busybox modifications 8 * Busybox modifications
9 * Copyright (c) 2000 Edward Betts <edward@debian.org>. 9 * Copyright (c) 2000 Edward Betts <edward@debian.org>.
10 * Aug 2003 Vladimir Oleynik - reduced 464 bytes. 10 * Aug 2003 Vladimir Oleynik - reduced 464 bytes.
11 * 11 *
diff --git a/coreutils/false.c b/coreutils/false.c
index a07b99d95..5cf238409 100644
--- a/coreutils/false.c
+++ b/coreutils/false.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini false implementation for busybox 3 * Mini false implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/id.c b/coreutils/id.c
index 971e7cdad..602b26ec3 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -47,7 +47,7 @@ extern int id_main(int argc, char **argv)
47#ifdef CONFIG_SELINUX 47#ifdef CONFIG_SELINUX
48 int is_flask_enabled_flag = is_flask_enabled(); 48 int is_flask_enabled_flag = is_flask_enabled();
49#endif 49#endif
50 50
51 flags = bb_getopt_ulflags(argc, argv, "ugrn"); 51 flags = bb_getopt_ulflags(argc, argv, "ugrn");
52 52
53 if (((flags & (JUST_USER | JUST_GROUP)) == (JUST_USER | JUST_GROUP)) 53 if (((flags & (JUST_USER | JUST_GROUP)) == (JUST_USER | JUST_GROUP))
diff --git a/coreutils/install.c b/coreutils/install.c
index 82773b8de..305e02b0d 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -48,7 +48,7 @@ static const struct option install_long_options[] = {
48 { "owner", 0, NULL, 'o' }, 48 { "owner", 0, NULL, 'o' },
49 { 0, 0, 0, 0 } 49 { 0, 0, 0, 0 }
50}; 50};
51 51
52extern int install_main(int argc, char **argv) 52extern int install_main(int argc, char **argv)
53{ 53{
54 struct stat statbuf; 54 struct stat statbuf;
@@ -116,7 +116,7 @@ extern int install_main(int argc, char **argv)
116 } 116 }
117 return(ret); 117 return(ret);
118 } 118 }
119 119
120 cp_mv_stat2(argv[argc - 1], &statbuf, lstat); 120 cp_mv_stat2(argv[argc - 1], &statbuf, lstat);
121 for (i = optind; i < argc - 1; i++) { 121 for (i = optind; i < argc - 1; i++) {
122 unsigned char *dest; 122 unsigned char *dest;
@@ -137,15 +137,15 @@ extern int install_main(int argc, char **argv)
137 /* Set the user and group id */ 137 /* Set the user and group id */
138 if (lchown(dest, uid, gid) == -1) { 138 if (lchown(dest, uid, gid) == -1) {
139 bb_perror_msg("cannot change ownership of %s", dest); 139 bb_perror_msg("cannot change ownership of %s", dest);
140 ret = EXIT_FAILURE; 140 ret = EXIT_FAILURE;
141 } 141 }
142 if (flags & INSTALL_OPT_STRIP) { 142 if (flags & INSTALL_OPT_STRIP) {
143 if (execlp("strip", "strip", dest, NULL) == -1) { 143 if (execlp("strip", "strip", dest, NULL) == -1) {
144 bb_error_msg("strip failed"); 144 bb_error_msg("strip failed");
145 ret = EXIT_FAILURE; 145 ret = EXIT_FAILURE;
146 } 146 }
147 } 147 }
148 } 148 }
149 149
150 return(ret); 150 return(ret);
151} 151}
diff --git a/coreutils/libcoreutils/Makefile b/coreutils/libcoreutils/Makefile
index b3a4e79b6..11867c602 100644
--- a/coreutils/libcoreutils/Makefile
+++ b/coreutils/libcoreutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/coreutils/libcoreutils/Makefile.in b/coreutils/libcoreutils/Makefile.in
index a7481d40a..d0e8b3a05 100644
--- a/coreutils/libcoreutils/Makefile.in
+++ b/coreutils/libcoreutils/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/coreutils/ln.c b/coreutils/ln.c
index 7c282b001..885ba61db 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini ln implementation for busybox 3 * Mini ln implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -88,14 +88,14 @@ extern int ln_main(int argc, char **argv)
88 if (flag & LN_SYMLINK) { 88 if (flag & LN_SYMLINK) {
89 link_func = symlink; 89 link_func = symlink;
90 } 90 }
91 91
92 if (link_func(*argv, src) != 0) { 92 if (link_func(*argv, src) != 0) {
93 bb_perror_msg(src); 93 bb_perror_msg(src);
94 status = EXIT_FAILURE; 94 status = EXIT_FAILURE;
95 } 95 }
96 96
97 free(src_name); 97 free(src_name);
98 98
99 } while ((++argv)[1]); 99 } while ((++argv)[1]);
100 100
101 return status; 101 return status;
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 2605ab12d..f7fa9a110 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -315,7 +315,7 @@ static int count_dirs(struct dnode **dn, int nfiles, int notsubdirs)
315 if (S_ISDIR(dn[i]->dstat.st_mode) 315 if (S_ISDIR(dn[i]->dstat.st_mode)
316 && (notsubdirs 316 && (notsubdirs
317 || ((dn[i]->name[0] != '.') 317 || ((dn[i]->name[0] != '.')
318 || (dn[i]->name[1] 318 || (dn[i]->name[1]
319 && ((dn[i]->name[1] != '.') 319 && ((dn[i]->name[1] != '.')
320 || dn[i]->name[2]))))) 320 || dn[i]->name[2])))))
321 dirs++; 321 dirs++;
@@ -1055,7 +1055,7 @@ extern int ls_main(int argc, char **argv)
1055 if ((all_fmt & STYLE_MASK) == STYLE_LONG && (all_fmt & LIST_ID_NUMERIC)) 1055 if ((all_fmt & STYLE_MASK) == STYLE_LONG && (all_fmt & LIST_ID_NUMERIC))
1056 all_fmt &= ~LIST_ID_NAME; /* don't list names if numeric uid */ 1056 all_fmt &= ~LIST_ID_NAME; /* don't list names if numeric uid */
1057#endif 1057#endif
1058 1058
1059 /* choose a display format */ 1059 /* choose a display format */
1060 if ((all_fmt & STYLE_MASK) == STYLE_AUTO) 1060 if ((all_fmt & STYLE_MASK) == STYLE_AUTO)
1061#if STYLE_AUTO != 0 1061#if STYLE_AUTO != 0
diff --git a/coreutils/md5_sha1_sum.c b/coreutils/md5_sha1_sum.c
index 83f6da180..64e069374 100644
--- a/coreutils/md5_sha1_sum.c
+++ b/coreutils/md5_sha1_sum.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (C) 2003 Glenn L. McGrath 2 * Copyright (C) 2003 Glenn L. McGrath
3 * Copyright (C) 2003 Erik Andersen 3 * Copyright (C) 2003-2004 Erik Andersen
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or 7 * the Free Software Foundation; either version 2 of the License, or
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index d5e9e17fe..7b2467b8f 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -50,7 +50,7 @@ extern int mknod_main(int argc, char **argv)
50 dev = (bb_xgetularg10_bnd(argv[2], 0, 255) << 8) 50 dev = (bb_xgetularg10_bnd(argv[2], 0, 255) << 8)
51 + bb_xgetularg10_bnd(argv[3], 0, 255); 51 + bb_xgetularg10_bnd(argv[3], 0, 255);
52 } 52 }
53 53
54 if (argc == 2) { 54 if (argc == 2) {
55 name = *argv; 55 name = *argv;
56 if (mknod(name, mode, dev) == 0) { 56 if (mknod(name, mode, dev) == 0) {
diff --git a/coreutils/mv.c b/coreutils/mv.c
index c28d0500e..4f08dedc0 100644
--- a/coreutils/mv.c
+++ b/coreutils/mv.c
@@ -75,7 +75,7 @@ extern int mv_main(int argc, char **argv)
75 goto DO_MOVE; 75 goto DO_MOVE;
76 } 76 }
77 } 77 }
78 78
79 do { 79 do {
80 dest = concat_path_file(last, bb_get_last_path_component(*argv)); 80 dest = concat_path_file(last, bb_get_last_path_component(*argv));
81 81
@@ -84,7 +84,7 @@ extern int mv_main(int argc, char **argv)
84 } 84 }
85 85
86DO_MOVE: 86DO_MOVE:
87 87
88 if (dest_exists && !(flags & OPT_FILEUTILS_FORCE) && 88 if (dest_exists && !(flags & OPT_FILEUTILS_FORCE) &&
89 ((access(dest, W_OK) < 0 && isatty(0)) || 89 ((access(dest, W_OK) < 0 && isatty(0)) ||
90 (flags & OPT_FILEUTILS_INTERACTIVE))) { 90 (flags & OPT_FILEUTILS_INTERACTIVE))) {
@@ -119,7 +119,7 @@ DO_MOVE:
119 bb_perror_msg("cannot remove `%s'", dest); 119 bb_perror_msg("cannot remove `%s'", dest);
120 goto RET_1; 120 goto RET_1;
121 } 121 }
122 } 122 }
123 if ((copy_file(*argv, dest, 123 if ((copy_file(*argv, dest,
124 FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS) >= 0) && 124 FILEUTILS_RECUR | FILEUTILS_PRESERVE_STATUS) >= 0) &&
125 (remove_file(*argv, FILEUTILS_RECUR | FILEUTILS_FORCE) >= 0)) { 125 (remove_file(*argv, FILEUTILS_RECUR | FILEUTILS_FORCE) >= 0)) {
@@ -132,7 +132,7 @@ RET_1:
132RET_0: 132RET_0:
133 if (dest != last) { 133 if (dest != last) {
134 free((void *) dest); 134 free((void *) dest);
135 } 135 }
136 } while (*++argv != last); 136 } while (*++argv != last);
137 137
138 return (status); 138 return (status);
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 76f59686b..053b01ee5 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -106,7 +106,7 @@ static int print_esc __P((char *escstart));
106static int print_formatted __P((char *format, int argc, char **argv)); 106static int print_formatted __P((char *format, int argc, char **argv));
107static long xstrtol __P((char *s)); 107static long xstrtol __P((char *s));
108static unsigned long xstrtoul __P((char *s)); 108static unsigned long xstrtoul __P((char *s));
109static void print_direc __P( (char *start, size_t length, 109static void print_direc __P( (char *start, size_t length,
110 int field_width, int precision, char *argument)); 110 int field_width, int precision, char *argument));
111static void print_esc_char __P((int c)); 111static void print_esc_char __P((int c));
112static void print_esc_string __P((char *str)); 112static void print_esc_string __P((char *str));
@@ -214,7 +214,7 @@ static int print_formatted(char *format, int argc, char **argv)
214 ++f; 214 ++f;
215 ++direc_length; 215 ++direc_length;
216 } 216 }
217 /* 217 /*
218 if (!strchr ("diouxXfeEgGcs", *f)) 218 if (!strchr ("diouxXfeEgGcs", *f))
219 fprintf(stderr, "%%%c: invalid directive", *f); 219 fprintf(stderr, "%%%c: invalid directive", *f);
220 */ 220 */
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 3f6037170..a10e5bb4f 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -66,7 +66,7 @@ extern int rmdir_main(int argc, char **argv)
66 } 66 }
67 break; 67 break;
68 } while (1); 68 } while (1);
69 69
70 } while (*++argv); 70 } while (*++argv);
71 71
72 return status; 72 return status;
diff --git a/coreutils/tail.c b/coreutils/tail.c
index d588ccdd1..b18064a38 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -118,7 +118,7 @@ int tail_main(int argc, char **argv)
118 /* Allow legacy syntax of an initial numeric option without -n. */ 118 /* Allow legacy syntax of an initial numeric option without -n. */
119 if (argc >=2 && ((argv[1][0] == '+') || ((argv[1][0] == '-') 119 if (argc >=2 && ((argv[1][0] == '+') || ((argv[1][0] == '-')
120 /* && (isdigit)(argv[1][1]) */ 120 /* && (isdigit)(argv[1][1]) */
121 && (((unsigned int)(argv[1][1] - '0')) <= 9)))) 121 && (((unsigned int)(argv[1][1] - '0')) <= 9))))
122 { 122 {
123 optind = 2; 123 optind = 2;
124 optarg = argv[1]; 124 optarg = argv[1];
diff --git a/coreutils/tee.c b/coreutils/tee.c
index 73c2f8e9d..bb2896663 100644
--- a/coreutils/tee.c
+++ b/coreutils/tee.c
@@ -97,7 +97,7 @@ int tee_main(int argc, char **argv)
97 } 97 }
98#endif 98#endif
99 99
100 /* Now we need to check for i/o errors on stdin and the various 100 /* Now we need to check for i/o errors on stdin and the various
101 * output files. Since we know that the first entry in the output 101 * output files. Since we know that the first entry in the output
102 * file table is stdout, we can save one "if ferror" test by 102 * file table is stdout, we can save one "if ferror" test by
103 * setting the first entry to stdin and checking stdout error 103 * setting the first entry to stdin and checking stdout error
diff --git a/coreutils/test.c b/coreutils/test.c
index 2ad326ea6..419da5101 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * test implementation for busybox 3 * test implementation for busybox
4 * 4 *
5 * Copyright (c) by a whole pile of folks: 5 * Copyright (c) by a whole pile of folks:
6 * 6 *
7 * test(1); version 7-like -- author Erik Baalbergen 7 * test(1); version 7-like -- author Erik Baalbergen
8 * modified by Eric Gisin to be used as built-in. 8 * modified by Eric Gisin to be used as built-in.
@@ -10,7 +10,7 @@
10 * (-x -c -b -p -u -g -k) plus Korn's -L -nt -ot -ef and new -S (socket). 10 * (-x -c -b -p -u -g -k) plus Korn's -L -nt -ot -ef and new -S (socket).
11 * modified by J.T. Conklin for NetBSD. 11 * modified by J.T. Conklin for NetBSD.
12 * modified by Herbert Xu to be used as built-in in ash. 12 * modified by Herbert Xu to be used as built-in in ash.
13 * modified by Erik Andersen <andersen@codepoet.org> to be used 13 * modified by Erik Andersen <andersen@codepoet.org> to be used
14 * in busybox. 14 * in busybox.
15 * 15 *
16 * This program is free software; you can redistribute it and/or modify 16 * This program is free software; you can redistribute it and/or modify
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 3d780e167..645fb2174 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini touch implementation for busybox 3 * Mini touch implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 958fc80b8..1325245b8 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (c) Michiel Huisjes 5 * Copyright (c) Michiel Huisjes
6 * 6 *
7 * This version of tr is adapted from Minix tr and was modified 7 * This version of tr is adapted from Minix tr and was modified
8 * by Erik Andersen <andersen@codepoet.org> to be used in busybox. 8 * by Erik Andersen <andersen@codepoet.org> to be used in busybox.
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
@@ -20,7 +20,7 @@
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * 23 *
24 * Original copyright notice is retained at the end of this file. 24 * Original copyright notice is retained at the end of this file.
25 */ 25 */
26 26
@@ -213,24 +213,24 @@ extern int tr_main(int argc, char **argv)
213/* 213/*
214 * Copyright (c) 1987,1997, Prentice Hall 214 * Copyright (c) 1987,1997, Prentice Hall
215 * All rights reserved. 215 * All rights reserved.
216 * 216 *
217 * Redistribution and use of the MINIX operating system in source and 217 * Redistribution and use of the MINIX operating system in source and
218 * binary forms, with or without modification, are permitted provided 218 * binary forms, with or without modification, are permitted provided
219 * that the following conditions are met: 219 * that the following conditions are met:
220 * 220 *
221 * Redistributions of source code must retain the above copyright 221 * Redistributions of source code must retain the above copyright
222 * notice, this list of conditions and the following disclaimer. 222 * notice, this list of conditions and the following disclaimer.
223 * 223 *
224 * Redistributions in binary form must reproduce the above 224 * Redistributions in binary form must reproduce the above
225 * copyright notice, this list of conditions and the following 225 * copyright notice, this list of conditions and the following
226 * disclaimer in the documentation and/or other materials provided 226 * disclaimer in the documentation and/or other materials provided
227 * with the distribution. 227 * with the distribution.
228 * 228 *
229 * Neither the name of Prentice Hall nor the names of the software 229 * Neither the name of Prentice Hall nor the names of the software
230 * authors or contributors may be used to endorse or promote 230 * authors or contributors may be used to endorse or promote
231 * products derived from this software without specific prior 231 * products derived from this software without specific prior
232 * written permission. 232 * written permission.
233 * 233 *
234 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND 234 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
235 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 235 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
236 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 236 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
diff --git a/coreutils/true.c b/coreutils/true.c
index d19e749aa..3e7eb0111 100644
--- a/coreutils/true.c
+++ b/coreutils/true.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini true implementation for busybox 3 * Mini true implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index 1734ed419..96da7caf3 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -18,7 +18,7 @@
18 * Based on specification from 18 * Based on specification from
19 * http://www.opengroup.org/onlinepubs/007904975/utilities/uuencode.html 19 * http://www.opengroup.org/onlinepubs/007904975/utilities/uuencode.html
20 * 20 *
21 * Bugs: the spec doesnt mention anything about "`\n`\n" prior to the "end" line 21 * Bugs: the spec doesnt mention anything about "`\n`\n" prior to the "end" line
22 */ 22 */
23 23
24 24
@@ -50,7 +50,7 @@ static int read_stduu(FILE *src_stream, FILE *dst_stream)
50 if (length > 60) { 50 if (length > 60) {
51 bb_error_msg_and_die("Line too long"); 51 bb_error_msg_and_die("Line too long");
52 } 52 }
53 53
54 line_ptr++; 54 line_ptr++;
55 /* Tolerate an overly long line to acomadate a possible exta '`' */ 55 /* Tolerate an overly long line to acomadate a possible exta '`' */
56 if (strlen(line_ptr) < length) { 56 if (strlen(line_ptr) < length) {
diff --git a/coreutils/wc.c b/coreutils/wc.c
index 779901524..0eb795c4b 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -26,7 +26,7 @@
26/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org) 26/* Mar 16, 2003 Manuel Novoa III (mjn3@codepoet.org)
27 * 27 *
28 * Rewritten to fix a number of problems and do some size optimizations. 28 * Rewritten to fix a number of problems and do some size optimizations.
29 * Problems in the previous busybox implementation (besides bloat) included: 29 * Problems in the previous busybox implementation (besides bloat) included:
30 * 1) broken 'wc -c' optimization (read note below) 30 * 1) broken 'wc -c' optimization (read note below)
31 * 2) broken handling of '-' args 31 * 2) broken handling of '-' args
32 * 3) no checking of ferror on EOF returns 32 * 3) no checking of ferror on EOF returns
@@ -110,33 +110,33 @@ int wc_main(int argc, char **argv)
110 char status = EXIT_SUCCESS; 110 char status = EXIT_SUCCESS;
111 char in_word; 111 char in_word;
112 char print_type; 112 char print_type;
113 113
114 print_type = bb_getopt_ulflags(argc, argv, wc_opts); 114 print_type = bb_getopt_ulflags(argc, argv, wc_opts);
115 115
116 if (print_type == 0) { 116 if (print_type == 0) {
117 print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_CHARS); 117 print_type = (1 << WC_LINES) | (1 << WC_WORDS) | (1 << WC_CHARS);
118 } 118 }
119 119
120 argv += optind; 120 argv += optind;
121 if (!*argv) { 121 if (!*argv) {
122 *--argv = (char *) bb_msg_standard_input; 122 *--argv = (char *) bb_msg_standard_input;
123 } 123 }
124 124
125 memset(totals, 0, sizeof(totals)); 125 memset(totals, 0, sizeof(totals));
126 126
127 pcounts = counts; 127 pcounts = counts;
128 128
129 do { 129 do {
130 ++num_files; 130 ++num_files;
131 if (!(fp = bb_wfopen_input(*argv))) { 131 if (!(fp = bb_wfopen_input(*argv))) {
132 status = EXIT_FAILURE; 132 status = EXIT_FAILURE;
133 continue; 133 continue;
134 } 134 }
135 135
136 memset(counts, 0, sizeof(counts)); 136 memset(counts, 0, sizeof(counts));
137 linepos = 0; 137 linepos = 0;
138 in_word = 0; 138 in_word = 0;
139 139
140 do { 140 do {
141 ++counts[WC_CHARS]; 141 ++counts[WC_CHARS];
142 c = getc(fp); 142 c = getc(fp);
@@ -177,21 +177,21 @@ int wc_main(int argc, char **argv)
177 } else { 177 } else {
178 continue; 178 continue;
179 } 179 }
180 180
181 counts[WC_WORDS] += in_word; 181 counts[WC_WORDS] += in_word;
182 in_word = 0; 182 in_word = 0;
183 if (c == EOF) { 183 if (c == EOF) {
184 break; 184 break;
185 } 185 }
186 } while (1); 186 } while (1);
187 187
188 if (totals[WC_LENGTH] < counts[WC_LENGTH]) { 188 if (totals[WC_LENGTH] < counts[WC_LENGTH]) {
189 totals[WC_LENGTH] = counts[WC_LENGTH]; 189 totals[WC_LENGTH] = counts[WC_LENGTH];
190 } 190 }
191 totals[WC_LENGTH] -= counts[WC_LENGTH]; 191 totals[WC_LENGTH] -= counts[WC_LENGTH];
192 192
193 bb_fclose_nonstdin(fp); 193 bb_fclose_nonstdin(fp);
194 194
195 OUTPUT: 195 OUTPUT:
196 s = fmt_str + 1; /* Skip the leading space on 1st pass. */ 196 s = fmt_str + 1; /* Skip the leading space on 1st pass. */
197 u = 0; 197 u = 0;
@@ -202,16 +202,16 @@ int wc_main(int argc, char **argv)
202 } 202 }
203 totals[u] += pcounts[u]; 203 totals[u] += pcounts[u];
204 } while (++u < 4); 204 } while (++u < 4);
205 205
206 s += 8; /* Set the format to the empty string. */ 206 s += 8; /* Set the format to the empty string. */
207 207
208 if (*argv != bb_msg_standard_input) { 208 if (*argv != bb_msg_standard_input) {
209 s -= 3; /* We have a name, so do %s conversion. */ 209 s -= 3; /* We have a name, so do %s conversion. */
210 } 210 }
211 bb_printf(s, *argv); 211 bb_printf(s, *argv);
212 212
213 } while (*++argv); 213 } while (*++argv);
214 214
215 /* If more than one file was processed, we want the totals. To save some 215 /* If more than one file was processed, we want the totals. To save some
216 * space, we set the pcounts ptr to the totals array. This has the side 216 * space, we set the pcounts ptr to the totals array. This has the side
217 * effect of trashing the totals array after outputting it, but that's 217 * effect of trashing the totals array after outputting it, but that's
@@ -222,6 +222,6 @@ int wc_main(int argc, char **argv)
222 pcounts = totals; 222 pcounts = totals;
223 goto OUTPUT; 223 goto OUTPUT;
224 } 224 }
225 225
226 bb_fflush_stdout_and_exit(status); 226 bb_fflush_stdout_and_exit(status);
227} 227}
diff --git a/coreutils/who.c b/coreutils/who.c
index 1bf552056..9561db132 100644
--- a/coreutils/who.c
+++ b/coreutils/who.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/*---------------------------------------------------------------------- 2/*----------------------------------------------------------------------
3 * Mini who is used to display user name, login time, 3 * Mini who is used to display user name, login time,
4 * idle time and host name. 4 * idle time and host name.
5 * 5 *
6 * Author: Da Chen <dchen@ayrnetworks.com> 6 * Author: Da Chen <dchen@ayrnetworks.com>
@@ -10,7 +10,7 @@
10 * as published by the Free Software Foundation: 10 * as published by the Free Software Foundation:
11 * http://www.gnu.org/copyleft/gpl.html 11 * http://www.gnu.org/copyleft/gpl.html
12 * 12 *
13 * Copyright (c) 2002 AYR Networks, Inc. 13 * Copyright (c) 2002 AYR Networks, Inc.
14 *---------------------------------------------------------------------- 14 *----------------------------------------------------------------------
15 */ 15 */
16 16
@@ -30,21 +30,21 @@ extern int who_main(int argc, char **argv)
30 struct utmp *ut; 30 struct utmp *ut;
31 struct stat st; 31 struct stat st;
32 int devlen, len; 32 int devlen, len;
33 time_t now, idle; 33 time_t now, idle;
34 34
35 if (argc > 1) 35 if (argc > 1)
36 bb_show_usage(); 36 bb_show_usage();
37 37
38 setutent(); 38 setutent();
39 devlen = sizeof("/dev/") - 1; 39 devlen = sizeof("/dev/") - 1;
40 printf("USER TTY IDLE FROM HOST\n"); 40 printf("USER TTY IDLE FROM HOST\n");
41 41
42 while ((ut = getutent()) != NULL) { 42 while ((ut = getutent()) != NULL) {
43 char name[40]; 43 char name[40];
44 44
45 if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) { 45 if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) {
46 len = strlen(ut->ut_line); 46 len = strlen(ut->ut_line);
47 if (ut->ut_line[0] == '/') { 47 if (ut->ut_line[0] == '/') {
48 strncpy(name, ut->ut_line, len); 48 strncpy(name, ut->ut_line, len);
49 name[len] = '\0'; 49 name[len] = '\0';
50 strcpy(ut->ut_line, ut->ut_line + devlen); 50 strcpy(ut->ut_line, ut->ut_line + devlen);
@@ -53,27 +53,27 @@ extern int who_main(int argc, char **argv)
53 strncpy(name+devlen, ut->ut_line, len); 53 strncpy(name+devlen, ut->ut_line, len);
54 name[devlen+len] = '\0'; 54 name[devlen+len] = '\0';
55 } 55 }
56 56
57 printf("%-10s %-8s ", ut->ut_user, ut->ut_line); 57 printf("%-10s %-8s ", ut->ut_user, ut->ut_line);
58 58
59 if (stat(name, &st) == 0) { 59 if (stat(name, &st) == 0) {
60 now = time(NULL); 60 now = time(NULL);
61 idle = now - st.st_atime; 61 idle = now - st.st_atime;
62 62
63 if (idle < 60) 63 if (idle < 60)
64 printf("00:00m "); 64 printf("00:00m ");
65 else if (idle < (60 * 60)) 65 else if (idle < (60 * 60))
66 printf("00:%02dm ", (int)(idle / 60)); 66 printf("00:%02dm ", (int)(idle / 60));
67 else if (idle < (24 * 60 * 60)) 67 else if (idle < (24 * 60 * 60))
68 printf("%02d:%02dm ", (int)(idle / (60 * 60)), 68 printf("%02d:%02dm ", (int)(idle / (60 * 60)),
69 (int)(idle % (60 * 60)) / 60); 69 (int)(idle % (60 * 60)) / 60);
70 else if (idle < (24 * 60 * 60 * 365)) 70 else if (idle < (24 * 60 * 60 * 365))
71 printf("%03ddays ", (int)(idle / (24 * 60 * 60))); 71 printf("%03ddays ", (int)(idle / (24 * 60 * 60)));
72 else 72 else
73 printf("%02dyears ", (int) (idle / (24 * 60 * 60 * 365))); 73 printf("%02dyears ", (int) (idle / (24 * 60 * 60 * 365)));
74 } else 74 } else
75 printf("%-8s ", "?"); 75 printf("%-8s ", "?");
76 76
77 printf("%-12.12s %s\n", ctime(&(ut->ut_tv.tv_sec)) + 4, ut->ut_host); 77 printf("%-12.12s %s\n", ctime(&(ut->ut_tv.tv_sec)) + 4, ut->ut_host);
78 } 78 }
79 } 79 }
diff --git a/debian/changelog b/debian/changelog
index 22d3ccb05..d9f82e376 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -100,7 +100,7 @@ busybox-cvs (0.60.99.cvs20030426-10) unstable; urgency=low
100busybox-cvs (0.60.99.cvs20030426-9) unstable; urgency=low 100busybox-cvs (0.60.99.cvs20030426-9) unstable; urgency=low
101 101
102 * modutils/depmod.c 102 * modutils/depmod.c
103 - fix base_dir for modules.dep 103 - fix base_dir for modules.dep
104 104
105 -- Bastian Blank <waldi@debian.org> Sat, 07 Jun 2003 14:52:54 +0200 105 -- Bastian Blank <waldi@debian.org> Sat, 07 Jun 2003 14:52:54 +0200
106 106
@@ -236,13 +236,13 @@ busybox-cvs (0.60.99.cvs20030114-1) unstable; urgency=low
236busybox-cvs (0.60.99.cvs20030105-1) unstable; urgency=low 236busybox-cvs (0.60.99.cvs20030105-1) unstable; urgency=low
237 237
238 * Fix ip command build failure on ia64 (Closes: #172580 238 * Fix ip command build failure on ia64 (Closes: #172580
239 * Dont build with BSD partition table support in fdisk, fails on m68k 239 * Dont build with BSD partition table support in fdisk, fails on m68k
240 240
241 -- Glenn McGrath <bug1@home> Sun, 5 Jan 2003 12:48:05 +1100 241 -- Glenn McGrath <bug1@home> Sun, 5 Jan 2003 12:48:05 +1100
242 242
243busybox-cvs (0.60.99.cvs20030104-2) unstable; urgency=low 243busybox-cvs (0.60.99.cvs20030104-2) unstable; urgency=low
244 244
245 * floppy-retriever needs the cut command in the udeb 245 * floppy-retriever needs the cut command in the udeb
246 246
247 -- Glenn McGrath <bug1@debian.org> Sat, 4 Jan 2003 17:13:05 +1100 247 -- Glenn McGrath <bug1@debian.org> Sat, 4 Jan 2003 17:13:05 +1100
248 248
@@ -380,7 +380,7 @@ busybox (1:0.51-4) unstable; urgency=low
380busybox (1:0.51-3) unstable; urgency=low 380busybox (1:0.51-3) unstable; urgency=low
381 381
382 * This is the "I am an idiot" release. 382 * This is the "I am an idiot" release.
383 * Make cp and mv work again (closes: #97290) 383 * Make cp and mv work again (closes: #97290)
384 * Fix the version number. 384 * Fix the version number.
385 385
386 -- Erik Andersen <andersee@debian.org> Sat, 12 May 2001 17:35:58 -0600 386 -- Erik Andersen <andersee@debian.org> Sat, 12 May 2001 17:35:58 -0600
@@ -401,13 +401,13 @@ busybox (0.51-1) unstable; urgency=low
401 for complete details) 401 for complete details)
402 * Force USE_SYSTEM_PWD_GRP=false, so busybox bypasses 402 * Force USE_SYSTEM_PWD_GRP=false, so busybox bypasses
403 the glibc NSS libraries. (closes: #93362) 403 the glibc NSS libraries. (closes: #93362)
404 * Fixed a bug in sed's address range handling (closes: #91758) 404 * Fixed a bug in sed's address range handling (closes: #91758)
405 * Removed irrelevant cruft from the bottem of debian/changelog 405 * Removed irrelevant cruft from the bottem of debian/changelog
406 406
407 -- Erik Andersen <andersee@debian.org> Tue, 10 Apr 2001 14:07:29 -0600 407 -- Erik Andersen <andersee@debian.org> Tue, 10 Apr 2001 14:07:29 -0600
408 408
409busybox (0.50-2) unstable; urgency=low 409busybox (0.50-2) unstable; urgency=low
410 410
411 * Enabled freeramdisk and pivot_root in the udeb (closes: #91336) 411 * Enabled freeramdisk and pivot_root in the udeb (closes: #91336)
412 * Disabled lash (the busybox shell) in the udeb (closes: #91337) 412 * Disabled lash (the busybox shell) in the udeb (closes: #91337)
413 * fixed a bug in syslog, a problem with rebooting when booted as 413 * fixed a bug in syslog, a problem with rebooting when booted as
@@ -417,7 +417,7 @@ busybox (0.50-2) unstable; urgency=low
417 417
418 418
419busybox (0.50-2) unstable; urgency=low 419busybox (0.50-2) unstable; urgency=low
420 420
421 * Enabled freeramdisk and pivot_root in the udeb (closes: #91336) 421 * Enabled freeramdisk and pivot_root in the udeb (closes: #91336)
422 * Disabled lash (the busybox shell) in the udeb (closes: #91337) 422 * Disabled lash (the busybox shell) in the udeb (closes: #91337)
423 * fixed a bug in syslog, a problem with rebooting when booted as 423 * fixed a bug in syslog, a problem with rebooting when booted as
@@ -446,7 +446,7 @@ busybox (0.49-1) unstable; urgency=low
446busybox (0.48-1) unstable; urgency=low 446busybox (0.48-1) unstable; urgency=low
447 447
448 * Lots more source updates and bug fixes. See changelog for details. 448 * Lots more source updates and bug fixes. See changelog for details.
449 * Now includes .udeb support for the debian-installer. The .udeb 449 * Now includes .udeb support for the debian-installer. The .udeb
450 probably needs some more work, but this should be a good start. 450 probably needs some more work, but this should be a good start.
451 451
452 -- Erik Andersen <andersee@debian.org> Wed, 13 Dec 2000 08:36:07 -0700 452 -- Erik Andersen <andersee@debian.org> Wed, 13 Dec 2000 08:36:07 -0700
@@ -465,11 +465,11 @@ busybox (0.46-1) unstable; urgency=low
465 465
466busybox (0.45-1) unstable; urgency=low 466busybox (0.45-1) unstable; urgency=low
467 467
468 * First attempt at packaging BusyBox as a .deb. This has been in 468 * First attempt at packaging BusyBox as a .deb. This has been in
469 in the Debian boot-floppies CVS tree forever. Hopefully, having it as a 469 in the Debian boot-floppies CVS tree forever. Hopefully, having it as a
470 standalone app will make life easier for me, the debian-installer team, and 470 standalone app will make life easier for me, the debian-installer team, and
471 everyone else as well... 471 everyone else as well...
472 * I have created a busybox-static that can be used as a rescue shell when you 472 * I have created a busybox-static that can be used as a rescue shell when you
473 hose your system. Just invoke "busybox sh" to fir up the shell. This has 473 hose your system. Just invoke "busybox sh" to fir up the shell. This has
474 every app provided by busybox staically linked in. There have been several 474 every app provided by busybox staically linked in. There have been several
475 times in the past that I would have loved to have this sitting on my system 475 times in the past that I would have loved to have this sitting on my system
diff --git a/debian/control b/debian/control
index 232408048..391a02dcf 100644
--- a/debian/control
+++ b/debian/control
@@ -64,7 +64,7 @@ Description: Tiny utilities for the debian-installer
64 counterparts. 64 counterparts.
65 . 65 .
66 busybox-udeb is used by the debian-installer, so unless you are working 66 busybox-udeb is used by the debian-installer, so unless you are working
67 on the debian-installer, this package is not for you. Installing this 67 on the debian-installer, this package is not for you. Installing this
68 on your Debian system is a very, very bad idea. You have been warned. 68 on your Debian system is a very, very bad idea. You have been warned.
69 69
70Package: busybox-cvs-floppy-udeb 70Package: busybox-cvs-floppy-udeb
@@ -83,6 +83,6 @@ Description: Tiny utilities for the debian-installer floppy images
83 counterparts. 83 counterparts.
84 . 84 .
85 busybox-udeb is used by the debian-installer, so unless you are working 85 busybox-udeb is used by the debian-installer, so unless you are working
86 on the debian-installer, this package is not for you. Installing this 86 on the debian-installer, this package is not for you. Installing this
87 on your Debian system is a very, very bad idea. You have been warned. 87 on your Debian system is a very, very bad idea. You have been warned.
88 88
diff --git a/debianutils/Config.in b/debianutils/Config.in
index 399ccae6b..7cf7cadb5 100644
--- a/debianutils/Config.in
+++ b/debianutils/Config.in
@@ -33,7 +33,7 @@ config CONFIG_RUN_PARTS
33 It is useful to set up a directory like cron.daily, where you need to 33 It is useful to set up a directory like cron.daily, where you need to
34 execute all the scripts in that directory. 34 execute all the scripts in that directory.
35 35
36 In this implementation of run-parts some features (such as report mode) 36 In this implementation of run-parts some features (such as report mode)
37 are not implemented. 37 are not implemented.
38 38
39 Unless you know that run-parts is used in some of your scripts 39 Unless you know that run-parts is used in some of your scripts
diff --git a/debianutils/Makefile b/debianutils/Makefile
index 13181eadb..0282b83c4 100644
--- a/debianutils/Makefile
+++ b/debianutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/debianutils/Makefile.in b/debianutils/Makefile.in
index 46530174f..dabef27ef 100644
--- a/debianutils/Makefile.in
+++ b/debianutils/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/debianutils/mktemp.c b/debianutils/mktemp.c
index ecc985fb2..9fdf79bfa 100644
--- a/debianutils/mktemp.c
+++ b/debianutils/mktemp.c
@@ -40,7 +40,7 @@ extern int mktemp_main(int argc, char **argv)
40 } 40 }
41 else if (opt != 'q') { 41 else if (opt != 'q') {
42 bb_show_usage(); 42 bb_show_usage();
43 } 43 }
44 } 44 }
45 45
46 if (optind + 1 != argc) { 46 if (optind + 1 != argc) {
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c
index 53d33cec5..6205595bf 100644
--- a/debianutils/run_parts.c
+++ b/debianutils/run_parts.c
@@ -8,7 +8,7 @@
8 * Based on the Debian run-parts program, version 1.15 8 * Based on the Debian run-parts program, version 1.15
9 * Copyright (C) 1996 Jeff Noxon <jeff@router.patch.net>, 9 * Copyright (C) 1996 Jeff Noxon <jeff@router.patch.net>,
10 * Copyright (C) 1996-1999 Guy Maor <maor@debian.org> 10 * Copyright (C) 1996-1999 Guy Maor <maor@debian.org>
11 * 11 *
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by 14 * it under the terms of the GNU General Public License as published by
@@ -31,21 +31,21 @@
31 * attempt to write a program! :-) . */ 31 * attempt to write a program! :-) . */
32 32
33/* This piece of code is heavily based on the original version of run-parts, 33/* This piece of code is heavily based on the original version of run-parts,
34 * taken from debian-utils. I've only removed the long options and a the 34 * taken from debian-utils. I've only removed the long options and a the
35 * report mode. As the original run-parts support only long options, I've 35 * report mode. As the original run-parts support only long options, I've
36 * broken compatibility because the BusyBox policy doesn't allow them. 36 * broken compatibility because the BusyBox policy doesn't allow them.
37 * The supported options are: 37 * The supported options are:
38 * -t test. Print the name of the files to be executed, without 38 * -t test. Print the name of the files to be executed, without
39 * execute them. 39 * execute them.
40 * -a ARG argument. Pass ARG as an argument the program executed. It can 40 * -a ARG argument. Pass ARG as an argument the program executed. It can
41 * be repeated to pass multiple arguments. 41 * be repeated to pass multiple arguments.
42 * -u MASK umask. Set the umask of the program executed to MASK. */ 42 * -u MASK umask. Set the umask of the program executed to MASK. */
43 43
44/* TODO 44/* TODO
45 * done - convert calls to error in perror... and remove error() 45 * done - convert calls to error in perror... and remove error()
46 * done - convert malloc/realloc to their x... counterparts 46 * done - convert malloc/realloc to their x... counterparts
47 * done - remove catch_sigchld 47 * done - remove catch_sigchld
48 * done - use bb's concat_path_file() 48 * done - use bb's concat_path_file()
49 * done - declare run_parts_main() as extern and any other function as static? 49 * done - declare run_parts_main() as extern and any other function as static?
50 */ 50 */
51 51
@@ -85,7 +85,7 @@ int run_parts_main(int argc, char **argv)
85 /* Set the umask of the programs executed */ 85 /* Set the umask of the programs executed */
86 case 'u': 86 case 'u':
87 /* Check and set the umask of the program executed. As stated in the original 87 /* Check and set the umask of the program executed. As stated in the original
88 * run-parts, the octal conversion in libc is not foolproof; it will take the 88 * run-parts, the octal conversion in libc is not foolproof; it will take the
89 * 8 and 9 digits under some circumstances. We'll just have to live with it. 89 * 8 and 9 digits under some circumstances. We'll just have to live with it.
90 */ 90 */
91 umask(bb_xgetlarg(optarg, 8, 0, 07777)); 91 umask(bb_xgetlarg(optarg, 8, 0, 07777));
diff --git a/debianutils/which.c b/debianutils/which.c
index ccfd16344..999dded36 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Which implementation for busybox 3 * Which implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ extern int which_main(int argc, char **argv)
53 count = 5; 53 count = 5;
54 } 54 }
55 55
56 while (argc-- > 0) { 56 while (argc-- > 0) {
57 char *buf; 57 char *buf;
58 char *path_n; 58 char *path_n;
59 char found = 0; 59 char found = 0;
diff --git a/docs/busybox.net/about.html b/docs/busybox.net/about.html
index 9242e759e..c08626386 100644
--- a/docs/busybox.net/about.html
+++ b/docs/busybox.net/about.html
@@ -26,7 +26,7 @@ nodes in /dev, a few configuration files in /etc, and a Linux kernel.
26 26
27BusyBox is maintained by <a href= 27BusyBox is maintained by <a href=
28"http://codepoet.org/andersen/erik/erik.html">Erik Andersen</a>, and 28"http://codepoet.org/andersen/erik/erik.html">Erik Andersen</a>, and
29licensed under the 29licensed under the
30<a href= "http://www.gnu.org/copyleft/gpl.html">GNU GENERAL PUBLIC LICENSE</a> 30<a href= "http://www.gnu.org/copyleft/gpl.html">GNU GENERAL PUBLIC LICENSE</a>
31 31
32<p> 32<p>
@@ -37,7 +37,7 @@ licensed under the
37Please visit our sponsors and thank them for their 37Please visit our sponsors and thank them for their
38support! They have provided money for equipment and 38support! They have provided money for equipment and
39bandwidth. Next time you need help with a project, 39bandwidth. Next time you need help with a project,
40consider these fine companies! 40consider these fine companies!
41 41
42 42
43<ul> 43<ul>
@@ -57,7 +57,7 @@ consider these fine companies!
57</ul> 57</ul>
58 58
59If you wish to be a sponsor, or if you have already contributed and would like 59If you wish to be a sponsor, or if you have already contributed and would like
60your name added here, email <a href= "mailto:andersen@codepoet.org">Erik</a>. 60your name added here, email <a href= "mailto:andersen@codepoet.org">Erik</a>.
61 61
62 62
63<!--#include file="footer.html" --> 63<!--#include file="footer.html" -->
diff --git a/docs/busybox.net/busybox-growth.ps b/docs/busybox.net/busybox-growth.ps
index 123f38114..2379defa4 100644
--- a/docs/busybox.net/busybox-growth.ps
+++ b/docs/busybox.net/busybox-growth.ps
@@ -213,7 +213,7 @@ gnudict begin
213/PentE { stroke [] 0 setdash gsave 213/PentE { stroke [] 0 setdash gsave
214 translate 0 hpt M 4 {72 rotate 0 hpt L} repeat 214 translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
215 closepath stroke grestore } def 215 closepath stroke grestore } def
216/CircE { stroke [] 0 setdash 216/CircE { stroke [] 0 setdash
217 hpt 0 360 arc stroke } def 217 hpt 0 360 arc stroke } def
218/Opaque { gsave closepath 1 setgray fill grestore 0 setgray closepath } def 218/Opaque { gsave closepath 1 setgray fill grestore 0 setgray closepath } def
219/DiaW { stroke [] 0 setdash vpt add M 219/DiaW { stroke [] 0 setdash vpt add M
@@ -233,7 +233,7 @@ gnudict begin
233/PentW { stroke [] 0 setdash gsave 233/PentW { stroke [] 0 setdash gsave
234 translate 0 hpt M 4 {72 rotate 0 hpt L} repeat 234 translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
235 Opaque stroke grestore } def 235 Opaque stroke grestore } def
236/CircW { stroke [] 0 setdash 236/CircW { stroke [] 0 setdash
237 hpt 0 360 arc Opaque stroke } def 237 hpt 0 360 arc Opaque stroke } def
238/BoxFill { gsave Rec 1 setgray fill grestore } def 238/BoxFill { gsave Rec 1 setgray fill grestore } def
239end 239end
diff --git a/docs/busybox.net/copyright.txt b/docs/busybox.net/copyright.txt
index a2b8032a0..528338da9 100644
--- a/docs/busybox.net/copyright.txt
+++ b/docs/busybox.net/copyright.txt
@@ -1,6 +1,6 @@
1 1
2The code and graphics on this website (and it's mirror sites, if any) are 2The code and graphics on this website (and it's mirror sites, if any) are
3Copyright (c) 1999-2003 by Erik Andersen. All rights reserved. 3Copyright (c) 1999-2004 by Erik Andersen. All rights reserved.
4 4
5Documents on this Web site including their graphical elements, design, and 5Documents on this Web site including their graphical elements, design, and
6layout are protected by trade dress and other laws and MAY BE COPIED OR 6layout are protected by trade dress and other laws and MAY BE COPIED OR
diff --git a/docs/busybox.net/cvs_anon.html b/docs/busybox.net/cvs_anon.html
index 896a38679..f823d0535 100644
--- a/docs/busybox.net/cvs_anon.html
+++ b/docs/busybox.net/cvs_anon.html
@@ -18,8 +18,8 @@ CVS modules by running the following command (all on one line):
18cvs -z3 -d:pserver:anonymous@busybox.net:/var/cvs co -c </pre> 18cvs -z3 -d:pserver:anonymous@busybox.net:/var/cvs co -c </pre>
19 19
20<p> 20<p>
21If you wish, you can then check out a local copy of any of the 21If you wish, you can then check out a local copy of any of the
22available modules. The following is an example of how to grab 22available modules. The following is an example of how to grab
23a copy of busybox and tinylogin: 23a copy of busybox and tinylogin:
24<pre> 24<pre>
25 cvs -z3 -d:pserver:anonymous@busybox.net:/var/cvs co -P busybox tinylogin</pre> 25 cvs -z3 -d:pserver:anonymous@busybox.net:/var/cvs co -P busybox tinylogin</pre>
@@ -41,7 +41,7 @@ recommend you should use the same:
41 diff -ubBwpN 41 diff -ubBwpN
42 checkout -P</pre> 42 checkout -P</pre>
43 43
44<p> 44<p>
45Once you've checked out a copy of the source tree, you can update your 45Once you've checked out a copy of the source tree, you can update your
46source tree at any time so it is in sync with the latest and greatest by 46source tree at any time so it is in sync with the latest and greatest by
47running the command: 47running the command:
diff --git a/docs/busybox.net/cvs_howto.html b/docs/busybox.net/cvs_howto.html
index cff3a353c..837d6cd61 100644
--- a/docs/busybox.net/cvs_howto.html
+++ b/docs/busybox.net/cvs_howto.html
@@ -12,16 +12,16 @@ For the impatient, the following is probably about all you need to know:
12<dl> 12<dl>
13 <dt><pre>cvs checkout -c</pre> 13 <dt><pre>cvs checkout -c</pre>
14 <dd>Will list the modules available for checkout 14 <dd>Will list the modules available for checkout
15 <dt><pre>cvs checkout &lt module name &gt</pre> 15 <dt><pre>cvs checkout &lt module name &gt</pre>
16 <dd>Will checkout the named module 16 <dd>Will checkout the named module
17 <dt><pre>cvs co &lt module name &gt</pre> 17 <dt><pre>cvs co &lt module name &gt</pre>
18 <dd>Same thing 18 <dd>Same thing
19 <dt><pre>cvs update</pre> 19 <dt><pre>cvs update</pre>
20 20
21 <dd>Updates your local archive so it is in sync with the repository 21 <dd>Updates your local archive so it is in sync with the repository
22 -- your local updates are left intact. Tries to merge upstream updates 22 -- your local updates are left intact. Tries to merge upstream updates
23 into your local updates. You will see the following tags when it is 23 into your local updates. You will see the following tags when it is
24 updating your local repository: C means conflict, U means update, 24 updating your local repository: C means conflict, U means update,
25 P means patched, and M means modified. 25 P means patched, and M means modified.
26 <dt><pre>cvs up</pre> 26 <dt><pre>cvs up</pre>
27 <dd>Same thing 27 <dd>Same thing
diff --git a/docs/busybox.net/cvs_write.html b/docs/busybox.net/cvs_write.html
index f7c642f7d..b27338d79 100644
--- a/docs/busybox.net/cvs_write.html
+++ b/docs/busybox.net/cvs_write.html
@@ -4,8 +4,8 @@
4<h3>CVS Read/Write Access</h3> 4<h3>CVS Read/Write Access</h3>
5 5
6If you want to be able to commit things to CVS, first contribute some 6If you want to be able to commit things to CVS, first contribute some
7stuff to show you are serious. Then, very nicely ask 7stuff to show you are serious. Then, very nicely ask
8<a href="mailto:andersen@codepoet.org">Erik Andersen</a> if he will set you up with 8<a href="mailto:andersen@codepoet.org">Erik Andersen</a> if he will set you up with
9an account. To access CVS, you will want to add the following to set up your environment: 9an account. To access CVS, you will want to add the following to set up your environment:
10<pre> 10<pre>
11$ export CVS_RSH=/usr/bin/ssh 11$ export CVS_RSH=/usr/bin/ssh
@@ -16,7 +16,7 @@ username...
16<p> 16<p>
17 17
18To obtain commit access, you will need to demonstrate you are 18To obtain commit access, you will need to demonstrate you are
19serious by submitting a few good patches first. Then, you will need to 19serious by submitting a few good patches first. Then, you will need to
20select a user-name to use when committing stuff, and finally, you will 20select a user-name to use when committing stuff, and finally, you will
21need to send me the username you have selected, an ssh key, and the email 21need to send me the username you have selected, an ssh key, and the email
22address where you prefer email to be sent (I will forward any email sent 22address where you prefer email to be sent (I will forward any email sent
@@ -24,8 +24,8 @@ to you, but not store it).
24 24
25<p> 25<p>
26Note that if you would prefer to keep your communications with me 26Note that if you would prefer to keep your communications with me
27private, you can encrypt your email using my 27private, you can encrypt your email using my
28<a href="http://www.codepoet.org/~andersen/erik/gpg.asc">public key</a>. 28<a href="http://www.codepoet.org/~andersen/erik/gpg.asc">public key</a>.
29 29
30<!--#include file="footer.html" --> 30<!--#include file="footer.html" -->
31 31
diff --git a/docs/busybox.net/docs.html b/docs/busybox.net/docs.html
index 330b7162c..fc9ac6d2b 100644
--- a/docs/busybox.net/docs.html
+++ b/docs/busybox.net/docs.html
@@ -2,7 +2,7 @@
2 2
3 3
4<h3>Documentation</h3> 4<h3>Documentation</h3>
5Current documentation for BusyBox includes: 5Current documentation for BusyBox includes:
6 6
7<ul> 7<ul>
8 <li><a href= 8 <li><a href=
diff --git a/docs/busybox.net/download.html b/docs/busybox.net/download.html
index d8a389023..a6a86ac33 100644
--- a/docs/busybox.net/download.html
+++ b/docs/busybox.net/download.html
@@ -8,7 +8,7 @@ Source for the latest release can always be
8downloaded from <a href="downloads">http://www.busybox.net/downloads</a>. 8downloaded from <a href="downloads">http://www.busybox.net/downloads</a>.
9 9
10<p> 10<p>
11You can also obtain <a href= "downloads/snapshots/">Daily Snapshots</a> of 11You can also obtain <a href= "downloads/snapshots/">Daily Snapshots</a> of
12the latest stable, and the latest development CVS source trees. 12the latest stable, and the latest development CVS source trees.
13 13
14<p> 14<p>
diff --git a/docs/busybox.net/footer.html b/docs/busybox.net/footer.html
index 3ca0e708b..9756f5dde 100644
--- a/docs/busybox.net/footer.html
+++ b/docs/busybox.net/footer.html
@@ -11,7 +11,7 @@
11 <font face="arial, helvetica, sans-serif" size="-1"> 11 <font face="arial, helvetica, sans-serif" size="-1">
12 <a HREF="/copyright.txt">Copyright &copy; 1999-2003 Erik Andersen</a> 12 <a HREF="/copyright.txt">Copyright &copy; 1999-2003 Erik Andersen</a>
13 <br> 13 <br>
14 Mail all comments, insults, suggestions and bribes to 14 Mail all comments, insults, suggestions and bribes to
15 <br> 15 <br>
16 Erik Andersen <A HREF="mailto:andersen@codepoet.org">andersen@codepoet.org</A><BR> 16 Erik Andersen <A HREF="mailto:andersen@codepoet.org">andersen@codepoet.org</A><BR>
17 </font> 17 </font>
diff --git a/docs/busybox.net/header.html b/docs/busybox.net/header.html
index 809a7c921..33638f322 100644
--- a/docs/busybox.net/header.html
+++ b/docs/busybox.net/header.html
@@ -18,7 +18,7 @@
18 </head> 18 </head>
19 19
20 <body> 20 <body>
21 <basefont face="lucida, helvetica, arial" size="3"> 21 <basefont face="lucida, helvetica, arial" size="3">
22 22
23 23
24 24
@@ -42,7 +42,7 @@
42 42
43<tr> 43<tr>
44 44
45<td valign="TOP"> 45<td valign="TOP">
46 <br><a href="/about.html">About</a> 46 <br><a href="/about.html">About</a>
47 <br><a href="/screenshot.html">Screenshot</a> 47 <br><a href="/screenshot.html">Screenshot</a>
48 <br><a href="/lists.html">Mailing Lists</a> 48 <br><a href="/lists.html">Mailing Lists</a>
@@ -67,7 +67,7 @@
67 <br><a href="http://lwn.net/">Linux Weekly News</a> 67 <br><a href="http://lwn.net/">Linux Weekly News</a>
68 <br><a href="http://www.tldp.org/HOWTO">Linux HOWTOs</a> 68 <br><a href="http://www.tldp.org/HOWTO">Linux HOWTOs</a>
69 69
70<!-- 70<!--
71 <a href="http://validator.w3.org/check/referer"><img 71 <a href="http://validator.w3.org/check/referer"><img
72 src="/images/vh40.gif" height=31 width=88 72 src="/images/vh40.gif" height=31 width=88
73 align=left border=0 alt="Valid HTML 4.0!"></a> 73 align=left border=0 alt="Valid HTML 4.0!"></a>
diff --git a/docs/busybox.net/images/busybox.png b/docs/busybox.net/images/busybox.png
index 5c4e82a8f..b1eb92f38 100644
--- a/docs/busybox.net/images/busybox.png
+++ b/docs/busybox.net/images/busybox.png
Binary files differ
diff --git a/docs/busybox.net/images/ltbutton2.png b/docs/busybox.net/images/ltbutton2.png
index 556f72a6c..9bad9496a 100644
--- a/docs/busybox.net/images/ltbutton2.png
+++ b/docs/busybox.net/images/ltbutton2.png
Binary files differ
diff --git a/docs/busybox.net/license.html b/docs/busybox.net/license.html
index ff1ba61f3..2cbf78b0b 100644
--- a/docs/busybox.net/license.html
+++ b/docs/busybox.net/license.html
@@ -18,11 +18,11 @@ is generally just abbreviated simply as the GPL license, or
18just the GPL. <a href="/products.html">Anyone thinking of shipping 18just the GPL. <a href="/products.html">Anyone thinking of shipping
19BusyBox as part of a product</a> should be familiar with the 19BusyBox as part of a product</a> should be familiar with the
20licensing terms under which they are allowed to use and 20licensing terms under which they are allowed to use and
21distribute BusyBox. You are advised to take a look over the 21distribute BusyBox. You are advised to take a look over the
22 22
23<ul> 23<ul>
24<li><a href="http://www.gnu.org/licenses/gpl.html">full text of 24<li><a href="http://www.gnu.org/licenses/gpl.html">full text of
25the GNU General Public License</a>, and 25the GNU General Public License</a>, and
26<li><a href="http://www.gnu.org/licenses/gpl-faq.html"> 26<li><a href="http://www.gnu.org/licenses/gpl-faq.html">
27Frequently Asked Questions about the GNU GPL</a> 27Frequently Asked Questions about the GNU GPL</a>
28</ul> 28</ul>
@@ -59,15 +59,15 @@ somewhere.
59 59
60<p> 60<p>
61 61
62<b>A written offer</b> generally means that somewhere in the 62<b>A written offer</b> generally means that somewhere in the
63docs for your product, you write something like 63docs for your product, you write something like
64 64
65<blockquote> 65<blockquote>
66The GPL source code contained in this product is available as a 66The GPL source code contained in this product is available as a
67free download from http://blah.blah.blah/ 67free download from http://blah.blah.blah/
68</blockquote> 68</blockquote>
69Or you can offer source by writing 69Or you can offer source by writing
70somewhere in the docs for your product something like 70somewhere in the docs for your product something like
71<blockquote> 71<blockquote>
72If you would like a copy of the GPL source code in this product 72If you would like a copy of the GPL source code in this product
73on a CD, please send $9.99 to &lt;address&gt; for the costs of 73on a CD, please send $9.99 to &lt;address&gt; for the costs of
@@ -85,7 +85,7 @@ firmware updates of their right to obtain source.
85Additionally, some people have the mistaken understanding that if 85Additionally, some people have the mistaken understanding that if
86they use unmodified GPL'd source code, they do not need to 86they use unmodified GPL'd source code, they do not need to
87distribute anything. This belief is not correct, and is not 87distribute anything. This belief is not correct, and is not
88supported by the 88supported by the
89<a href="http://www.gnu.org/licenses/gpl.html">text of GPL</a>. 89<a href="http://www.gnu.org/licenses/gpl.html">text of GPL</a>.
90Please do re-read it, and you 90Please do re-read it, and you
91will find there is no such provision. If you distribute any GPL'd 91will find there is no such provision. If you distribute any GPL'd
diff --git a/docs/busybox.net/lists.html b/docs/busybox.net/lists.html
index e44e7edf2..6e7d890d1 100644
--- a/docs/busybox.net/lists.html
+++ b/docs/busybox.net/lists.html
@@ -5,14 +5,14 @@
5 5
6<h3>Mailing List Information</h3> 6<h3>Mailing List Information</h3>
7BusyBox has a <a href="/lists/busybox/">mailing list</a> for discussion and 7BusyBox has a <a href="/lists/busybox/">mailing list</a> for discussion and
8development. You can subscribe by visiting 8development. You can subscribe by visiting
9<a href="http://codepoet.org/mailman/listinfo/busybox">this page</a>. 9<a href="http://codepoet.org/mailman/listinfo/busybox">this page</a>.
10 10
11<p> 11<p>
12There is also a mailing list for <a href="/lists/busybox-cvs/">active developers</a> 12There is also a mailing list for <a href="/lists/busybox-cvs/">active developers</a>
13wishing to read the complete diff of each and every change to busybox -- not for the 13wishing to read the complete diff of each and every change to busybox -- not for the
14faint of heart. Active developers can subscribe by visiting 14faint of heart. Active developers can subscribe by visiting
15<a href="http://codepoet.org/mailman/listinfo/busybox-cvs">this page</a>. 15<a href="http://codepoet.org/mailman/listinfo/busybox-cvs">this page</a>.
16 16
17<p> 17<p>
18 18
diff --git a/docs/busybox.net/news.html b/docs/busybox.net/news.html
index 3af3dca33..9d06eb543 100644
--- a/docs/busybox.net/news.html
+++ b/docs/busybox.net/news.html
@@ -107,8 +107,8 @@
107 107
108 <p> 108 <p>
109 109
110 The <a href="downloads/Changelog">changelog</a> has all 110 The <a href="downloads/Changelog">changelog</a> has all
111 the details. And as usual you can 111 the details. And as usual you can
112 <a href="downloads">download busybox here</a>. 112 <a href="downloads">download busybox here</a>.
113 113
114 <p>Have Fun! 114 <p>Have Fun!
@@ -117,7 +117,7 @@
117 117
118 118
119 <p> 119 <p>
120 <li><b>Old News</b><p> 120 <li><b>Old News</b><p>
121 <a href="/oldnews.html">Click here to read older news</a> 121 <a href="/oldnews.html">Click here to read older news</a>
122 122
123 123
diff --git a/docs/busybox.net/oldnews.html b/docs/busybox.net/oldnews.html
index a13bf7733..fa7566c0c 100644
--- a/docs/busybox.net/oldnews.html
+++ b/docs/busybox.net/oldnews.html
@@ -3,7 +3,7 @@
3 3
4<ul> 4<ul>
5 5
6 <li><b>10 December 2003 -- BusyBox 1.0.0-pre4 released</b><p> 6 <li><b>10 December 2003 -- BusyBox 1.0.0-pre4 released</b><p>
7 7
8 Here goes the fourth pre-release for the new BusyBox stable 8 Here goes the fourth pre-release for the new BusyBox stable
9 series. This release includes major rework to sed, lots of 9 series. This release includes major rework to sed, lots of
@@ -13,7 +13,7 @@
13 common applet, the dpkg applets has been cleaned up, and tons 13 common applet, the dpkg applets has been cleaned up, and tons
14 of random bugs have been fixed. Thanks everyone for all the 14 of random bugs have been fixed. Thanks everyone for all the
15 testing, bug reports, and patches! Once again, a big 15 testing, bug reports, and patches! Once again, a big
16 thank-you goes to Glenn McGrath (bug1) for stepping in and 16 thank-you goes to Glenn McGrath (bug1) for stepping in and
17 helping get patches merged! 17 helping get patches merged!
18 18
19 <p> 19 <p>
@@ -26,8 +26,8 @@
26 26
27 <p> 27 <p>
28 28
29 The <a href="downloads/Changelog">changelog</a> has all 29 The <a href="downloads/Changelog">changelog</a> has all
30 the details. And as usual you can 30 the details. And as usual you can
31 <a href="downloads">download busybox here</a>. 31 <a href="downloads">download busybox here</a>.
32 32
33 <p>Have Fun! 33 <p>Have Fun!
@@ -35,7 +35,7 @@
35 35
36 36
37 <p> 37 <p>
38 <li><b>12 Sept 2003 -- BusyBox 1.0.0-pre3 released</b><p> 38 <li><b>12 Sept 2003 -- BusyBox 1.0.0-pre3 released</b><p>
39 39
40 Here goes the third pre-release for the new BusyBox stable 40 Here goes the third pre-release for the new BusyBox stable
41 series. The last prerelease has held up quite well under 41 series. The last prerelease has held up quite well under
@@ -44,7 +44,7 @@
44 the testing, bug reports, and patches! 44 the testing, bug reports, and patches!
45 45
46 <p> 46 <p>
47 47
48 If you have submitted a patch or a bug report to the busybox 48 If you have submitted a patch or a bug report to the busybox
49 mailing list and no one has emailed you explaining why your 49 mailing list and no one has emailed you explaining why your
50 patch was rejected, it is safe to say that your patch has 50 patch was rejected, it is safe to say that your patch has
@@ -69,27 +69,27 @@
69 <p> 69 <p>
70 70
71 I had hoped this release would be out a month ago. And of 71 I had hoped this release would be out a month ago. And of
72 course, it wasn't since Erik became busy getting a release of 72 course, it wasn't since Erik became busy getting a release of
73 <a href="http://www.uclibc.org/">uClibc</a> 73 <a href="http://www.uclibc.org/">uClibc</a>
74 out the door. Many thanks to Glenn McGrath (bug1) for 74 out the door. Many thanks to Glenn McGrath (bug1) for
75 stepping in and helping get a bunch of patches merged! I am 75 stepping in and helping get a bunch of patches merged! I am
76 not even going to state a date for releasing BusyBox 1.0.0 76 not even going to state a date for releasing BusyBox 1.0.0
77 -pre4 (or the final 1.0.0). We're aiming for late September... 77 -pre4 (or the final 1.0.0). We're aiming for late September...
78 But if this release proves as to be exceptionally stable (or 78 But if this release proves as to be exceptionally stable (or
79 exceptionally unstable!), the next release may be very soon 79 exceptionally unstable!), the next release may be very soon
80 indeed. 80 indeed.
81 81
82 <p> 82 <p>
83 83
84 The <a href="downloads/Changelog">changelog</a> has all 84 The <a href="downloads/Changelog">changelog</a> has all
85 the details. And as usual you can 85 the details. And as usual you can
86 <a href="downloads">download busybox here</a>. 86 <a href="downloads">download busybox here</a>.
87 87
88 <p>Have Fun! 88 <p>Have Fun!
89 89
90 90
91 <p> 91 <p>
92 <li><b>30 July 2003 -- BusyBox 1.0.0-pre2 released</b><p> 92 <li><b>30 July 2003 -- BusyBox 1.0.0-pre2 released</b><p>
93 93
94 Here goes another pre release for the new BusyBox stable 94 Here goes another pre release for the new BusyBox stable
95 series. The last prerelease (pre1) was given quite a lot of 95 series. The last prerelease (pre1) was given quite a lot of
@@ -126,14 +126,14 @@
126 then... 126 then...
127 <p> 127 <p>
128 128
129 The <a href="downloads/Changelog">changelog</a> has all 129 The <a href="downloads/Changelog">changelog</a> has all
130 the details. As usual you can <a href="downloads">download busybox here</a>. 130 the details. As usual you can <a href="downloads">download busybox here</a>.
131 131
132 <p>Have Fun! 132 <p>Have Fun!
133 <p> 133 <p>
134 134
135 <p> 135 <p>
136 <li><b>15 July 2003 -- BusyBox 1.0.0-pre1 released</b><p> 136 <li><b>15 July 2003 -- BusyBox 1.0.0-pre1 released</b><p>
137 137
138 The busybox development series has been under construction for 138 The busybox development series has been under construction for
139 nearly two years now. Which is just entirely too long... So 139 nearly two years now. Which is just entirely too long... So
@@ -153,7 +153,7 @@
153 up) the final BusyBox 1.0.0 release should be ready by the end 153 up) the final BusyBox 1.0.0 release should be ready by the end
154 of July. 154 of July.
155 <p> 155 <p>
156 156
157 If you have submitted patches, and they are not in this release 157 If you have submitted patches, and they are not in this release
158 and I have not emailed you explaining why your patch was 158 and I have not emailed you explaining why your patch was
159 rejected, it is safe to say that I have lost your patch. That 159 rejected, it is safe to say that I have lost your patch. That
@@ -171,7 +171,7 @@
171 <p> 171 <p>
172 172
173 As usual you can <a href="downloads">download busybox here</a>. 173 As usual you can <a href="downloads">download busybox here</a>.
174 You don't really need to bother with the 174 You don't really need to bother with the
175 <a href="downloads/Changelog">changelog</a>, as the changes 175 <a href="downloads/Changelog">changelog</a>, as the changes
176 vs the stable version are way too extensive to easily enumerate. 176 vs the stable version are way too extensive to easily enumerate.
177 But you can take a look if you really want too. 177 But you can take a look if you really want too.
@@ -182,7 +182,7 @@
182 182
183 183
184 <p> 184 <p>
185 <li><b>26 October 2002 -- BusyBox 0.60.5 released</b><p> 185 <li><b>26 October 2002 -- BusyBox 0.60.5 released</b><p>
186 186
187 I am very pleased to announce that the BusyBox 0.60.5 (stable) 187 I am very pleased to announce that the BusyBox 0.60.5 (stable)
188 is now available for download. This is a bugfix release for 188 is now available for download. This is a bugfix release for
@@ -195,7 +195,7 @@
195 0.60.x series. Well, it turns out I'm a liar. But this time I 195 0.60.x series. Well, it turns out I'm a liar. But this time I
196 mean it (just like last time ;-). This will be the last 196 mean it (just like last time ;-). This will be the last
197 release for the 0.60.x series -- all further development work 197 release for the 0.60.x series -- all further development work
198 will be done for the development busybox tree. Expect the development 198 will be done for the development busybox tree. Expect the development
199 version to have its first real release very very soon now... 199 version to have its first real release very very soon now...
200 200
201 <p> 201 <p>
@@ -205,14 +205,14 @@
205 <p> 205 <p>
206 206
207 <p> 207 <p>
208 <li><b>18 September 2002 -- BusyBox 0.60.4 released</b><p> 208 <li><b>18 September 2002 -- BusyBox 0.60.4 released</b><p>
209 209
210 I am very pleased to announce that the BusyBox 0.60.4 210 I am very pleased to announce that the BusyBox 0.60.4
211 (stable) is now available for download. This is primarily 211 (stable) is now available for download. This is primarily
212 a bugfix release for the stable series to address all 212 a bugfix release for the stable series to address all
213 the problems that have turned up since the last 213 the problems that have turned up since the last
214 release. This will be the last release for the 0.60.x series. 214 release. This will be the last release for the 0.60.x series.
215 I mean it this time -- all further development work will be done 215 I mean it this time -- all further development work will be done
216 on the development busybox tree, which is quite solid now and 216 on the development busybox tree, which is quite solid now and
217 should soon be getting its first real release. 217 should soon be getting its first real release.
218 218
@@ -224,13 +224,13 @@
224 224
225 225
226 <p> 226 <p>
227 <li><b>27 April 2002 -- BusyBox 0.60.3 released</b><p> 227 <li><b>27 April 2002 -- BusyBox 0.60.3 released</b><p>
228 228
229 I am very pleased to announce that the BusyBox 0.60.3 (stable) is 229 I am very pleased to announce that the BusyBox 0.60.3 (stable) is
230 now available for download. This is primarily a bugfix release 230 now available for download. This is primarily a bugfix release
231 for the stable series. A number of problems have turned up since 231 for the stable series. A number of problems have turned up since
232 the last release, and this should address most of those problems. 232 the last release, and this should address most of those problems.
233 This should be the last release for the 0.60.x series. The 233 This should be the last release for the 0.60.x series. The
234 development busybox tree has been progressing nicely, and will 234 development busybox tree has been progressing nicely, and will
235 hopefully be ready to become the next stable release. 235 hopefully be ready to become the next stable release.
236 236
@@ -242,21 +242,21 @@
242 242
243 243
244 <p> 244 <p>
245 <li><b>6 March 2002 -- busybox.net now has mirrors!</b><p> 245 <li><b>6 March 2002 -- busybox.net now has mirrors!</b><p>
246 246
247 Busybox.net is now much more available, thanks to 247 Busybox.net is now much more available, thanks to
248 the fine folks at <a href= "http://i-netinnovations.com/">http://i-netinnovations.com/</a> 248 the fine folks at <a href= "http://i-netinnovations.com/">http://i-netinnovations.com/</a>
249 who are providing hosting for busybox.net and 249 who are providing hosting for busybox.net and
250 uclibc.org. In addition, we now have two mirrors: 250 uclibc.org. In addition, we now have two mirrors:
251 <a href= "http://busybox.linuxmagic.com/">http://busybox.linuxmagic.com/</a> 251 <a href= "http://busybox.linuxmagic.com/">http://busybox.linuxmagic.com/</a>
252 in Canada and 252 in Canada and
253 <a href= "http://busybox.csservers.de/">http://busybox.csservers.de/</a> 253 <a href= "http://busybox.csservers.de/">http://busybox.csservers.de/</a>
254 in Germany. I hope this makes things much more 254 in Germany. I hope this makes things much more
255 accessible for everyone! 255 accessible for everyone!
256 256
257 257
258<li> 258<li>
259<b>3 January 2002 -- Welcome to busybox.net!</b> 259<b>3 January 2002 -- Welcome to busybox.net!</b>
260 260
261<p>Thanks to the generosity of a number of busybox 261<p>Thanks to the generosity of a number of busybox
262users, we have been able to purchase busybox.net 262users, we have been able to purchase busybox.net
@@ -285,7 +285,7 @@ should be completely eliminated. Hopefully, too,
285some of you will volunteer to set up some mirror 285some of you will volunteer to set up some mirror
286sites, to help to distribute the load a bit.</p> 286sites, to help to distribute the load a bit.</p>
287 287
288<p><!-- 288<p><!--
289 <center> 289 <center>
290 Click here to help support busybox.net! 290 Click here to help support busybox.net!
291 <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 291 <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
@@ -316,7 +316,7 @@ everyone that has contributed!<br>
316</li> 316</li>
317 317
318<li> 318<li>
319<b>20 November 2001 -- BusyBox 0.60.2 released</b> 319<b>20 November 2001 -- BusyBox 0.60.2 released</b>
320 320
321<p>We am very pleased to announce that the BusyBox 321<p>We am very pleased to announce that the BusyBox
3220.60.2 (stable) is now released to the world. This 3220.60.2 (stable) is now released to the world. This
@@ -369,19 +369,19 @@ will not part with it... I will then need to pay the registry fee
369for a couple of years and start paying for bandwidth, so this will 369for a couple of years and start paying for bandwidth, so this will
370initially cost about $300. I would like to host busybox.net on my 370initially cost about $300. I would like to host busybox.net on my
371home machine (codepoet.org) so I have full control over the system, 371home machine (codepoet.org) so I have full control over the system,
372but to do that would require that I increase the level of bandwidth 372but to do that would require that I increase the level of bandwidth
373I am paying for. Did you know that so far this month, there 373I am paying for. Did you know that so far this month, there
374have been over 1.4 Gigabytes of busybox ftp downloads? I don't 374have been over 1.4 Gigabytes of busybox ftp downloads? I don't
375even <em>know</em> how much CVS bandwidth it requires. For the 375even <em>know</em> how much CVS bandwidth it requires. For the
376time being, Lineo has continued to graciously provide this 376time being, Lineo has continued to graciously provide this
377bandwidth, despite the fact that I no longer work for them. If I 377bandwidth, despite the fact that I no longer work for them. If I
378start running this all on my home machine, paying for the needed bandwidth 378start running this all on my home machine, paying for the needed bandwidth
379will start costing some money. 379will start costing some money.
380<p> 380<p>
381 381
382I was going to pay it all myself, but my wife didn't like that 382I was going to pay it all myself, but my wife didn't like that
383idea at all (big surprise). It turns out &lt;insert argument 383idea at all (big surprise). It turns out &lt;insert argument
384where she wins and I don't&gt; she has better ideas 384where she wins and I don't&gt; she has better ideas
385about what we should spend our money on that don't involve 385about what we should spend our money on that don't involve
386busybox. She suggested I should ask for contributions on the 386busybox. She suggested I should ask for contributions on the
387mailing list and web page. So... 387mailing list and web page. So...
@@ -390,8 +390,8 @@ mailing list and web page. So...
390I am hoping that if everyone could contribute a bit, we could pick 390I am hoping that if everyone could contribute a bit, we could pick
391up the busybox.net domain name and cover the bandwidth costs. I 391up the busybox.net domain name and cover the bandwidth costs. I
392know that busybox is being used by a lot of companies as well as 392know that busybox is being used by a lot of companies as well as
393individuals -- hopefully people and companies that are willing to 393individuals -- hopefully people and companies that are willing to
394contribute back a bit. So if everyone could please help out, that 394contribute back a bit. So if everyone could please help out, that
395would be wonderful! 395would be wonderful!
396<p> 396<p>
397 397
@@ -406,9 +406,9 @@ would be wonderful!
406 new features, no new applets. So without further ado, 406 new features, no new applets. So without further ado,
407 here it is. Come and get it. 407 here it is. Come and get it.
408 <p> 408 <p>
409 The 409 The
410 <a href="downloads/Changelog">changelog</a> has all 410 <a href="downloads/Changelog">changelog</a> has all
411 the details. As usual BusyBox 0.60.1 can be downloaded from 411 the details. As usual BusyBox 0.60.1 can be downloaded from
412 <a href="downloads">http://busybox.net/downloads</a>. 412 <a href="downloads">http://busybox.net/downloads</a>.
413 <p>Have Fun! 413 <p>Have Fun!
414 <p> 414 <p>
@@ -425,23 +425,23 @@ would be wonderful!
425 stable bug-free(tm) release out seems to be in order. This releases fixes 425 stable bug-free(tm) release out seems to be in order. This releases fixes
426 a memory leak in syslogd, a number of bugs in the ash and msh shells, and 426 a memory leak in syslogd, a number of bugs in the ash and msh shells, and
427 cleans up a number of things. 427 cleans up a number of things.
428 428
429 <p> 429 <p>
430 430
431 Those wanting an easy way to test the 0.60.0 release with uClibc can 431 Those wanting an easy way to test the 0.60.0 release with uClibc can
432 use <a href="http://user-mode-linux.sourceforge.net/">User-Mode Linux</a> 432 use <a href="http://user-mode-linux.sourceforge.net/">User-Mode Linux</a>
433 to give it a try by downloading and compiling 433 to give it a try by downloading and compiling
434 <a href="ftp://busybox.net/buildroot.tar.gz">buildroot.tar.gz</a>. 434 <a href="ftp://busybox.net/buildroot.tar.gz">buildroot.tar.gz</a>.
435 You don't have to be root or reboot your machine to run test this way. 435 You don't have to be root or reboot your machine to run test this way.
436 Preconfigured User-Mode Linux kernel source is also on busybox.net. 436 Preconfigured User-Mode Linux kernel source is also on busybox.net.
437 <p> 437 <p>
438 Another cool thing is the nifty <a href="downloads/tutorial/index.html"> 438 Another cool thing is the nifty <a href="downloads/tutorial/index.html">
439 BusyBox Tutorial</a> contributed by K Computing. This requires 439 BusyBox Tutorial</a> contributed by K Computing. This requires
440 a ShockWave plugin (or standalone viewer), so you may want to grab the 440 a ShockWave plugin (or standalone viewer), so you may want to grab the
441 the GPLed shockwave viewer from <a href="http://www.swift-tools.com/Flash/flash-0.4.10.tgz">here</a> 441 the GPLed shockwave viewer from <a href="http://www.swift-tools.com/Flash/flash-0.4.10.tgz">here</a>
442 to view the tutorial. 442 to view the tutorial.
443 <p> 443 <p>
444 444
445 Finally, In case you didn't notice anything odd about the 445 Finally, In case you didn't notice anything odd about the
446 version number of this release, let me point out that this release 446 version number of this release, let me point out that this release
447 is <em>not</em> 0.53, because I bumped the version number up a 447 is <em>not</em> 0.53, because I bumped the version number up a
@@ -456,12 +456,12 @@ would be wonderful!
456 released as part of a new BusyBox development series that will 456 released as part of a new BusyBox development series that will
457 have some not-yet-decided-on odd version number. Once things 457 have some not-yet-decided-on odd version number. Once things
458 stabilize and the new build system is working for everyone, then 458 stabilize and the new build system is working for everyone, then
459 I will release that as a new stable release series. 459 I will release that as a new stable release series.
460 460
461 <p> 461 <p>
462 The 462 The
463 <a href="downloads/Changelog">changelog</a> has all 463 <a href="downloads/Changelog">changelog</a> has all
464 the details. As usual BusyBox 0.60.0 can be downloaded from 464 the details. As usual BusyBox 0.60.0 can be downloaded from
465 <a href="downloads">http://busybox.net/downloads</a>. 465 <a href="downloads">http://busybox.net/downloads</a>.
466 <p>Have Fun! 466 <p>Have Fun!
467 <p> 467 <p>
@@ -478,18 +478,18 @@ would be wonderful!
478 and ash). 478 and ash).
479 479
480 <p> 480 <p>
481 The 481 The
482 <a href="downloads/Changelog">changelog</a> covers 482 <a href="downloads/Changelog">changelog</a> covers
483 some of the more obvious details, but there are many many things that 483 some of the more obvious details, but there are many many things that
484 are not mentioned, but have been improved in subtle ways. As usual, 484 are not mentioned, but have been improved in subtle ways. As usual,
485 BusyBox 0.52 can be downloaded from 485 BusyBox 0.52 can be downloaded from
486 <a href="downloads">http://busybox.net/downloads</a>. 486 <a href="downloads">http://busybox.net/downloads</a>.
487 <p>Have Fun! 487 <p>Have Fun!
488 <p> 488 <p>
489 489
490 490
491<li> <b>10 April 2001 - Graph of Busybox Growth </b> 491<li> <b>10 April 2001 - Graph of Busybox Growth </b>
492<br> 492<br>
493The illustrious Larry Doolittle has made a PostScript chart of the growth 493The illustrious Larry Doolittle has made a PostScript chart of the growth
494of the Busybox tarball size over time. It is available for downloading / 494of the Busybox tarball size over time. It is available for downloading /
495viewing <a href= "busybox-growth.ps"> right here</a>. 495viewing <a href= "busybox-growth.ps"> right here</a>.
@@ -523,9 +523,9 @@ turning off whichever applets you don't need.)
523 compiles on itanium systems (thanks to the Debian itanium porters 523 compiles on itanium systems (thanks to the Debian itanium porters
524 for letting me use their system!). 524 for letting me use their system!).
525 <p> 525 <p>
526 You can read the 526 You can read the
527 <a href="downloads/Changelog">changelog</a> for 527 <a href="downloads/Changelog">changelog</a> for
528 complete details. BusyBox 0.51 can be downloaded from 528 complete details. BusyBox 0.51 can be downloaded from
529 <a href="downloads">http://busybox.net/downloads</a>. 529 <a href="downloads">http://busybox.net/downloads</a>.
530 <p>Have Fun! 530 <p>Have Fun!
531 <p> 531 <p>
@@ -551,9 +551,9 @@ image</a>. Here's how you use it:
551<p> If you want to look at the contents of the initrd image, do this: 551<p> If you want to look at the contents of the initrd image, do this:
552 552
553<pre> 553<pre>
554 mount ./busybox.floppy.img /mnt -o loop -t msdos 554 mount ./busybox.floppy.img /mnt -o loop -t msdos
555 cp /mnt/initrd.gz /tmp 555 cp /mnt/initrd.gz /tmp
556 umount /mnt 556 umount /mnt
557 gunzip /tmp/initrd.gz 557 gunzip /tmp/initrd.gz
558 mount /tmp/initrd /mnt -o loop -t minix 558 mount /tmp/initrd /mnt -o loop -t minix
559</pre> 559</pre>
@@ -566,7 +566,7 @@ image</a>. Here's how you use it:
566 and tftp, and also fixes tons of bugs. Tab completion in the 566 and tftp, and also fixes tons of bugs. Tab completion in the
567 shell is now working very well, and the shell's environment variable 567 shell is now working very well, and the shell's environment variable
568 expansion was fixed. Tons of other things were fixed or made 568 expansion was fixed. Tons of other things were fixed or made
569 smaller. For a fairly complete overview, see the 569 smaller. For a fairly complete overview, see the
570 <a href="downloads/Changelog">changelog</a>. 570 <a href="downloads/Changelog">changelog</a>.
571 <p> 571 <p>
572 lash (the busybox shell) is still with us, fixed up a bit so it 572 lash (the busybox shell) is still with us, fixed up a bit so it
@@ -577,21 +577,21 @@ image</a>. Here's how you use it:
577 this shell, while very usable, does not provide an extensible 577 this shell, while very usable, does not provide an extensible
578 framework for adding in full Bourne shell behavior. So the first order of 578 framework for adding in full Bourne shell behavior. So the first order of
579 business as we begin working on the next BusyBox release will be to merge in the new shell 579 business as we begin working on the next BusyBox release will be to merge in the new shell
580 currently in progress at 580 currently in progress at
581 <a href="http://doolittle.faludi.com/~larry/parser.html">Larry Doolittle's website</a>. 581 <a href="http://doolittle.faludi.com/~larry/parser.html">Larry Doolittle's website</a>.
582 <p> 582 <p>
583 583
584 584
585<li> <b>27 January 2001 -- BusyBox 0.49 released</b> 585<li> <b>27 January 2001 -- BusyBox 0.49 released</b>
586<br> 586<br>
587 587
588 Several new applets, lots of bug fixes, cleanups, and many smaller 588 Several new applets, lots of bug fixes, cleanups, and many smaller
589 things made nicer. Several cleanups and improvements to the shell. 589 things made nicer. Several cleanups and improvements to the shell.
590 For a list of the most interesting changes 590 For a list of the most interesting changes
591 you might want to look at the <a href="downloads/Changelog">changelog</a>. 591 you might want to look at the <a href="downloads/Changelog">changelog</a>.
592 <p> 592 <p>
593 Special thanks go out to Matt Kraai and Larry Doolittle for all their 593 Special thanks go out to Matt Kraai and Larry Doolittle for all their
594 work on this release, and for keeping on top of things while I've been 594 work on this release, and for keeping on top of things while I've been
595 out of town. 595 out of town.
596 <p> 596 <p>
597 <em>Special Note</em><br> 597 <em>Special Note</em><br>
@@ -602,8 +602,8 @@ image</a>. Here's how you use it:
602 shell that will eventually replace lash is already under 602 shell that will eventually replace lash is already under
603 construction. This new shell is being developed by Larry 603 construction. This new shell is being developed by Larry
604 Doolittle, and could use all of our help. Please see the work in 604 Doolittle, and could use all of our help. Please see the work in
605 progress on <a href="http://doolittle.faludi.com/~larry/parser.html">Larry's website</a> 605 progress on <a href="http://doolittle.faludi.com/~larry/parser.html">Larry's website</a>
606 and help out if you can. This shell will be included in the next 606 and help out if you can. This shell will be included in the next
607 release of BusyBox. 607 release of BusyBox.
608 <p> 608 <p>
609 609
@@ -617,12 +617,12 @@ image</a>. Here's how you use it:
617 that 'tar -X' and 'tar --exclude' are both now in. Applets are 617 that 'tar -X' and 'tar --exclude' are both now in. Applets are
618 now looked up using a binary search making lash (the busybox 618 now looked up using a binary search making lash (the busybox
619 shell) much faster. For the new debian-installer (for Debian 619 shell) much faster. For the new debian-installer (for Debian
620 woody) a .udeb can now be generated. 620 woody) a .udeb can now be generated.
621 <p> 621 <p>
622 The curious can get a list of some of the more interesting changes by reading 622 The curious can get a list of some of the more interesting changes by reading
623 the <a href="downloads/Changelog">changelog</a>. 623 the <a href="downloads/Changelog">changelog</a>.
624 <p> 624 <p>
625 Many thanks go out to the many many people that have contributed to 625 Many thanks go out to the many many people that have contributed to
626 this release, especially Matt Kraai, Larry Doolittle, and Kent Robotti. 626 this release, especially Matt Kraai, Larry Doolittle, and Kent Robotti.
627 <p> 627 <p>
628<p> <li> <b>26 September 2000 -- BusyBox 0.47 released</b> 628<p> <li> <b>26 September 2000 -- BusyBox 0.47 released</b>
@@ -630,11 +630,11 @@ image</a>. Here's how you use it:
630 630
631 This release fixes lots of bugs (including an ugly bug in 0.46 631 This release fixes lots of bugs (including an ugly bug in 0.46
632 syslogd that could fork-bomb your system). Added several new 632 syslogd that could fork-bomb your system). Added several new
633 apps: rdate, wget, getopt, dos2unix, unix2dos, reset, unrpm, 633 apps: rdate, wget, getopt, dos2unix, unix2dos, reset, unrpm,
634 renice, xargs, and expr. syslogd now supports network logging. 634 renice, xargs, and expr. syslogd now supports network logging.
635 There are the usual tar updates. Most apps now use getopt for 635 There are the usual tar updates. Most apps now use getopt for
636 more correct option parsing. 636 more correct option parsing.
637 See the <a href="downloads/Changelog">changelog</a> 637 See the <a href="downloads/Changelog">changelog</a>
638 for complete details. 638 for complete details.
639 639
640 640
@@ -642,11 +642,11 @@ image</a>. Here's how you use it:
642<br> 642<br>
643 643
644 This release fixes several bugs (including a ugly bug in tar, 644 This release fixes several bugs (including a ugly bug in tar,
645 and fixes for NFSv3 mount support). Added a dumpkmap to allow 645 and fixes for NFSv3 mount support). Added a dumpkmap to allow
646 people to dump a binary keymaps for use with 'loadkmap', and a 646 people to dump a binary keymaps for use with 'loadkmap', and a
647 completely reworked 'grep' and 'sed' which should behave better. 647 completely reworked 'grep' and 'sed' which should behave better.
648 BusyBox shell can now also be used as a login shell. 648 BusyBox shell can now also be used as a login shell.
649 See the <a href="downloads/Changelog">changelog</a> 649 See the <a href="downloads/Changelog">changelog</a>
650 for complete details. 650 for complete details.
651 651
652 652
@@ -661,13 +661,13 @@ image</a>. Here's how you use it:
661 the <a href="downloads/Changelog">changelog</a> for 661 the <a href="downloads/Changelog">changelog</a> for
662 details). 662 details).
663 <p> 663 <p>
664 Also, some exciting infrastructure news! Busybox now has its own 664 Also, some exciting infrastructure news! Busybox now has its own
665 <a href="lists/busybox/">mailing list</a>, 665 <a href="lists/busybox/">mailing list</a>,
666 publically browsable 666 publically browsable
667 <a href="/cgi-bin/cvsweb/busybox/">CVS tree</a>, 667 <a href="/cgi-bin/cvsweb/busybox/">CVS tree</a>,
668 anonymous 668 anonymous
669 <a href="cvs_anon.html">CVS access</a>, and 669 <a href="cvs_anon.html">CVS access</a>, and
670 for those that are actively contributing there is even 670 for those that are actively contributing there is even
671 <a href="cvs_write.html">CVS write access</a>. 671 <a href="cvs_write.html">CVS write access</a>.
672 I think this will be a huge help to the ongoing development of BusyBox. 672 I think this will be a huge help to the ongoing development of BusyBox.
673 <p> 673 <p>
@@ -708,7 +708,7 @@ it should be logging stuff from both "A" and "B". As released in 0.43 only stuf
708from "A" would have been logged. This means that if init tries to log something 708from "A" would have been logged. This means that if init tries to log something
709while say ppp has the syslog open, init would block (which is bad, bad, bad). 709while say ppp has the syslog open, init would block (which is bad, bad, bad).
710<p> 710<p>
711Karl M. Hegbloom has created a fix for the problem. 711Karl M. Hegbloom has created a fix for the problem.
712Thanks Karl! 712Thanks Karl!
713 713
714 714
@@ -717,17 +717,17 @@ Thanks Karl!
717I have finally gotten everything into a state where I feel pretty 717I have finally gotten everything into a state where I feel pretty
718good about things. This is definitely the most stable, solid release 718good about things. This is definitely the most stable, solid release
719so far. A lot of bugs have been fixed, and the following new apps 719so far. A lot of bugs have been fixed, and the following new apps
720have been added: sh, basename, dirname, killall, uptime, 720have been added: sh, basename, dirname, killall, uptime,
721freeramdisk, tr, echo, test, and usleep. Tar has been completely 721freeramdisk, tr, echo, test, and usleep. Tar has been completely
722rewritten from scratch. Bss size has also been greatly reduced. 722rewritten from scratch. Bss size has also been greatly reduced.
723More details are available in the 723More details are available in the
724<a href="downloads/Changelog">changelog</a>. 724<a href="downloads/Changelog">changelog</a>.
725Oh, and as a special bonus, I wrote some fairly comprehensive 725Oh, and as a special bonus, I wrote some fairly comprehensive
726<em>documentation</em>, complete with examples and full usage information. 726<em>documentation</em>, complete with examples and full usage information.
727 727
728<p> 728<p>
729Many thanks go out to the fine people that have helped by submitting patches 729Many thanks go out to the fine people that have helped by submitting patches
730and bug reports; particularly instrumental in helping for this release were 730and bug reports; particularly instrumental in helping for this release were
731Karl Hegbloom, Pavel Roskin, Friedrich Vedder, Emanuele Caratti, 731Karl Hegbloom, Pavel Roskin, Friedrich Vedder, Emanuele Caratti,
732Bob Tinsley, Nicolas Pitre, Avery Pennarun, Arne Bernin, John Beppu, and Jim Gleason. 732Bob Tinsley, Nicolas Pitre, Avery Pennarun, Arne Bernin, John Beppu, and Jim Gleason.
733There were others so if I somehow forgot to mention you, I'm very sorry. 733There were others so if I somehow forgot to mention you, I'm very sorry.
@@ -770,9 +770,9 @@ labor, both Shaunalei and our new baby boy are doing wonderfully.
770So now that I am done with my excuse for the slow release cycle... 770So now that I am done with my excuse for the slow release cycle...
771Progress on the next release of BusyBox has been slow but steady. I expect 771Progress on the next release of BusyBox has been slow but steady. I expect
772to have a release sometime during the first week of April. This release will 772to have a release sometime during the first week of April. This release will
773include a number of important changes, including the addition of a shell, a 773include a number of important changes, including the addition of a shell, a
774re-write of tar (to accommodate the Linux Router Project), and syslogd can now 774re-write of tar (to accommodate the Linux Router Project), and syslogd can now
775accept multiple concurrent connections, fixing lots of unexpected blocking 775accept multiple concurrent connections, fixing lots of unexpected blocking
776problems. 776problems.
777 777
778 778
@@ -780,22 +780,22 @@ problems.
780<br> 780<br>
781 781
782 This is the most solid BusyBox release so far. Many, many 782 This is the most solid BusyBox release so far. Many, many
783 bugs have been fixed. See the 783 bugs have been fixed. See the
784 <a href="downloads/Changelog">changelog</a> for details. 784 <a href="downloads/Changelog">changelog</a> for details.
785 785
786 Of particular interest, init will now cleanly unmount 786 Of particular interest, init will now cleanly unmount
787 filesystems on reboot, cp and mv have been rewritten and 787 filesystems on reboot, cp and mv have been rewritten and
788 behave much better, and mount and umount no longer leak 788 behave much better, and mount and umount no longer leak
789 loop devices. Many thanks go out to Randolph Chung, 789 loop devices. Many thanks go out to Randolph Chung,
790 Karl M. Hegbloom, Taketoshi Sano, and Pavel Roskin for 790 Karl M. Hegbloom, Taketoshi Sano, and Pavel Roskin for
791 their hard work on this release of BusyBox. Please pound 791 their hard work on this release of BusyBox. Please pound
792 on it and let me know if you find any bugs. 792 on it and let me know if you find any bugs.
793 793
794<p> <li> <b>19 January 2000 -- BusyBox 0.41 released</b> 794<p> <li> <b>19 January 2000 -- BusyBox 0.41 released</b>
795<br> 795<br>
796 796
797 This release includes bugfixes to cp, mv, logger, true, false, 797 This release includes bugfixes to cp, mv, logger, true, false,
798 mkdir, syslogd, and init. New apps include wc, hostid, 798 mkdir, syslogd, and init. New apps include wc, hostid,
799 logname, tty, whoami, and yes. New features include loop device 799 logname, tty, whoami, and yes. New features include loop device
800 support in mount and umount, and better TERM handling by init. 800 support in mount and umount, and better TERM handling by init.
801 The changelog can be found <a href="downloads/Changelog">here</a>. 801 The changelog can be found <a href="downloads/Changelog">here</a>.
@@ -806,7 +806,7 @@ problems.
806 This release includes bugfixes to init (now includes inittab support), 806 This release includes bugfixes to init (now includes inittab support),
807 syslogd, head, logger, du, grep, cp, mv, sed, dmesg, ls, kill, gunzip, and mknod. 807 syslogd, head, logger, du, grep, cp, mv, sed, dmesg, ls, kill, gunzip, and mknod.
808 New apps include sort, uniq, lsmod, rmmod, fbset, and loadacm. 808 New apps include sort, uniq, lsmod, rmmod, fbset, and loadacm.
809 In particular, this release fixes an important bug in tar which 809 In particular, this release fixes an important bug in tar which
810 in some cases produced serious security problems. 810 in some cases produced serious security problems.
811 As always, the changelog can be found <a href="downloads/Changelog">here</a>. 811 As always, the changelog can be found <a href="downloads/Changelog">here</a>.
812 812
@@ -814,19 +814,19 @@ problems.
814<br> 814<br>
815 I have received permission from Bruce Perens (the original author of BusyBox) 815 I have received permission from Bruce Perens (the original author of BusyBox)
816 to set up this site as the new primary website for BusyBox. This website 816 to set up this site as the new primary website for BusyBox. This website
817 will always contain pointers to the latest and greatest, and will also 817 will always contain pointers to the latest and greatest, and will also
818 contain the latest documentation on how to use BusyBox, what it can do, 818 contain the latest documentation on how to use BusyBox, what it can do,
819 what arguments its apps support, etc. 819 what arguments its apps support, etc.
820 820
821<p> <li> <b>10 December 1999 -- BusyBox 0.39 released</b> 821<p> <li> <b>10 December 1999 -- BusyBox 0.39 released</b>
822<br> 822<br>
823 This release includes fixes to init, reboot, halt, kill, and ls, and contains 823 This release includes fixes to init, reboot, halt, kill, and ls, and contains
824 the new apps ping, hostname, mkfifo, free, tail, du, tee, and head. A full 824 the new apps ping, hostname, mkfifo, free, tail, du, tee, and head. A full
825 changelog can be found <a href="downloads/Changelog">here</a>. 825 changelog can be found <a href="downloads/Changelog">here</a>.
826<p> <li> <b>5 December 1999 -- BusyBox 0.38 released</b> 826<p> <li> <b>5 December 1999 -- BusyBox 0.38 released</b>
827<br> 827<br>
828 This release includes fixes to tar, cat, ls, dd, rm, umount, find, df, 828 This release includes fixes to tar, cat, ls, dd, rm, umount, find, df,
829 and make install, and includes new apps syslogd/klogd and logger. 829 and make install, and includes new apps syslogd/klogd and logger.
830 830
831 831
832</ul> 832</ul>
diff --git a/docs/busybox.net/screenshot.html b/docs/busybox.net/screenshot.html
index 5f1035489..1f8e8c81b 100644
--- a/docs/busybox.net/screenshot.html
+++ b/docs/busybox.net/screenshot.html
@@ -12,7 +12,7 @@ Everybody loves to look at screenshots, so here is a live action screenshot of B
12font-family: monospace; font-size: smaller;" width="100"> 12font-family: monospace; font-size: smaller;" width="100">
13 13
14 14
15$ ./busybox 15$ ./busybox
16BusyBox v1.00-pre3 (2003.09.12-05:48+0000) multi-call binary 16BusyBox v1.00-pre3 (2003.09.12-05:48+0000) multi-call binary
17 17
18Usage: busybox [function] [arguments]... 18Usage: busybox [function] [arguments]...
diff --git a/docs/busybox.sgml b/docs/busybox.sgml
index bd8b1697c..b581868ef 100644
--- a/docs/busybox.sgml
+++ b/docs/busybox.sgml
@@ -2,7 +2,7 @@
2<book id="BusyBoxDocumentation"> 2<book id="BusyBoxDocumentation">
3 <bookinfo> 3 <bookinfo>
4 <title>BusyBox - The Swiss Army Knife of Embedded Linux</title> 4 <title>BusyBox - The Swiss Army Knife of Embedded Linux</title>
5 5
6 <legalnotice> 6 <legalnotice>
7 <para> 7 <para>
8 This documentation is free software; you can redistribute 8 This documentation is free software; you can redistribute
@@ -11,21 +11,21 @@
11 version 2 of the License, or (at your option) any later 11 version 2 of the License, or (at your option) any later
12 version. 12 version.
13 </para> 13 </para>
14 14
15 <para> 15 <para>
16 This program is distributed in the hope that it will be 16 This program is distributed in the hope that it will be
17 useful, but WITHOUT ANY WARRANTY; without even the implied 17 useful, but WITHOUT ANY WARRANTY; without even the implied
18 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 See the GNU General Public License for more details. 19 See the GNU General Public License for more details.
20 </para> 20 </para>
21 21
22 <para> 22 <para>
23 You should have received a copy of the GNU General Public 23 You should have received a copy of the GNU General Public
24 License along with this program; if not, write to the Free 24 License along with this program; if not, write to the Free
25 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 25 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
26 MA 02111-1307 USA 26 MA 02111-1307 USA
27 </para> 27 </para>
28 28
29 <para> 29 <para>
30 For more details see the file COPYING in the source 30 For more details see the file COPYING in the source
31 distribution of Linux. 31 distribution of Linux.
@@ -45,7 +45,7 @@
45 for any small or embedded system. The utilities in BusyBox generally have 45 for any small or embedded system. The utilities in BusyBox generally have
46 fewer options than their full-featured GNU cousins; however, the options 46 fewer options than their full-featured GNU cousins; however, the options
47 that are included provide the expected functionality and behave very much 47 that are included provide the expected functionality and behave very much
48 like their GNU counterparts. 48 like their GNU counterparts.
49 </para> 49 </para>
50 50
51 <para> 51 <para>
@@ -97,7 +97,7 @@
97 97
98 <para> 98 <para>
99 will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled 99 will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
100 into BusyBox). 100 into BusyBox).
101 </para> 101 </para>
102 102
103 <para> 103 <para>
@@ -112,7 +112,7 @@
112 </para> 112 </para>
113 113
114 <para> 114 <para>
115 will also cause BusyBox to behave as 'ls'. 115 will also cause BusyBox to behave as 'ls'.
116 </para> 116 </para>
117 117
118 </sect1> 118 </sect1>
@@ -121,8 +121,8 @@
121 <title>Common options</title> 121 <title>Common options</title>
122 122
123 <para> 123 <para>
124 Most BusyBox commands support the <emphasis>--help</emphasis> option to provide 124 Most BusyBox commands support the <emphasis>--help</emphasis> option to provide
125 a terse runtime description of their behavior. 125 a terse runtime description of their behavior.
126 </para> 126 </para>
127 </sect1> 127 </sect1>
128 </chapter> 128 </chapter>
@@ -143,7 +143,7 @@
143 dpkg-deb, du, dumpkmap, dumpleases, dutmp, echo, egrep, env, expr, 143 dpkg-deb, du, dumpkmap, dumpleases, dutmp, echo, egrep, env, expr,
144 false, fbset, fdflush, fdformat, fgrep, find, fold, free, freeramdisk, 144 false, fbset, fdflush, fdformat, fgrep, find, fold, free, freeramdisk,
145 fsck.minix, ftpget, ftpput, getopt, getty, grep, gunzip, gzip, 145 fsck.minix, ftpget, ftpput, getopt, getty, grep, gunzip, gzip,
146 halt, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock, 146 halt, hdparm, head, hexdump, hostid, hostname, httpd, hush, hwclock,
147 id, ifconfig, ifdown, ifup, inetd, init, insmod, ip, ipcalc, iplink, 147 id, ifconfig, ifdown, ifup, inetd, init, insmod, ip, ipcalc, iplink,
148 iproute, iptunnel, kill, killall, klogd, lash, length, linuxrc, 148 iproute, iptunnel, kill, killall, klogd, lash, length, linuxrc,
149 ln, loadfont, loadkmap, logger, login, logname, logread, 149 ln, loadfont, loadkmap, logger, login, logname, logread,
@@ -156,7 +156,7 @@
156 sha1sum, sleep, sort, start-stop-daemon, strings, stty, su, sulogin, 156 sha1sum, sleep, sort, start-stop-daemon, strings, stty, su, sulogin,
157 swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, telnetd, 157 swapoff, swapon, sync, syslogd, tail, tar, tee, telnet, telnetd,
158 test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc, 158 test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc,
159 udhcpd, umount, uname, uncompress, uniq, unix2dos, unzip, 159 udhcpd, umount, uname, uncompress, uniq, unix2dos, unzip,
160 uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch, 160 uptime, usleep, uudecode, uuencode, vconfig, vi, vlock, watch,
161 watchdog, wc, wget, which, who, whoami, xargs, yes, zcat, [ 161 watchdog, wc, wget, which, who, whoami, xargs, yes, zcat, [
162 162
@@ -382,7 +382,7 @@
382 </screen> 382 </screen>
383 </para> 383 </para>
384 </sect1> 384 </sect1>
385 385
386 <sect1 id="chown"> 386 <sect1 id="chown">
387 <title>chown</title> 387 <title>chown</title>
388 <para> 388 <para>
@@ -706,7 +706,7 @@
706 </screen> 706 </screen>
707 </para> 707 </para>
708 </sect1> 708 </sect1>
709 709
710 <sect1 id="dirname"> 710 <sect1 id="dirname">
711 <title>dirname</title> 711 <title>dirname</title>
712 712
@@ -773,24 +773,24 @@
773 <title>dpkg-deb</title> 773 <title>dpkg-deb</title>
774 774
775 <para> 775 <para>
776 Usage: dpkg-deb [OPTION] archive [directory] 776 Usage: dpkg-deb [OPTION] archive [directory]
777 </para> 777 </para>
778 778
779 <para> 779 <para>
780 Debian package archive (.deb) manipulation tool 780 Debian package archive (.deb) manipulation tool
781 </para> 781 </para>
782 782
783 <para> 783 <para>
784 Options: 784 Options:
785 </para> 785 </para>
786 786
787 <para> 787 <para>
788 <screen> 788 <screen>
789 -c List the contents of the filesystem tree archive portion of the package 789 -c List the contents of the filesystem tree archive portion of the package
790 -e Extracts the control information files from a package archive into the specified directory. 790 -e Extracts the control information files from a package archive into the specified directory.
791 If no directory is specified then a subdirectory DEBIAN in the current directory is used. 791 If no directory is specified then a subdirectory DEBIAN in the current directory is used.
792 -x Silently extracts the filesystem tree from a package archive into the specified directory. 792 -x Silently extracts the filesystem tree from a package archive into the specified directory.
793 -X Extracts the filesystem tree from a package archive into the specified directory, listing the files as it goes. 793 -X Extracts the filesystem tree from a package archive into the specified directory, listing the files as it goes.
794 If required the specified directory (but not its parents) will be created. 794 If required the specified directory (but not its parents) will be created.
795 </screen> 795 </screen>
796 <para> 796 <para>
@@ -1193,7 +1193,7 @@
1193 </screen> 1193 </screen>
1194 </para> 1194 </para>
1195 </sect1> 1195 </sect1>
1196 1196
1197 <sect1 id="getopt"> 1197 <sect1 id="getopt">
1198 <title>getopt</title> 1198 <title>getopt</title>
1199 1199
@@ -1426,7 +1426,7 @@
1426 <para> 1426 <para>
1427 Prints out a unique 32-bit identifier for the current 1427 Prints out a unique 32-bit identifier for the current
1428 machine. The 32-bit identifier is intended to be unique 1428 machine. The 32-bit identifier is intended to be unique
1429 among all UNIX systems in existence. 1429 among all UNIX systems in existence.
1430 </para> 1430 </para>
1431 </sect1> 1431 </sect1>
1432 1432
@@ -1592,7 +1592,7 @@
1592 1592
1593 1593
1594 <para> 1594 <para>
1595 Valid actions include: sysinit, respawn, askfirst, wait, 1595 Valid actions include: sysinit, respawn, askfirst, wait,
1596 once, and ctrlaltdel. 1596 once, and ctrlaltdel.
1597 </para> 1597 </para>
1598 1598
@@ -1631,7 +1631,7 @@
1631 respawn, except that before running the specified process it 1631 respawn, except that before running the specified process it
1632 displays the line "Please press Enter to activate this console." 1632 displays the line "Please press Enter to activate this console."
1633 and then waits for the user to press enter before starting the 1633 and then waits for the user to press enter before starting the
1634 specified process. 1634 specified process.
1635 </para> 1635 </para>
1636 1636
1637 <para> 1637 <para>
@@ -1994,7 +1994,7 @@
1994 </para> 1994 </para>
1995 1995
1996 <para> 1996 <para>
1997 1997
1998 </para> 1998 </para>
1999 1999
2000 <para> 2000 <para>
@@ -2266,7 +2266,7 @@
2266 2266
2267 <para> 2267 <para>
2268 <screen> 2268 <screen>
2269 $ mknod /dev/fd0 b 2 0 2269 $ mknod /dev/fd0 b 2 0
2270 $ mknod -m 644 /tmp/pipe p 2270 $ mknod -m 644 /tmp/pipe p
2271 </screen> 2271 </screen>
2272 </para> 2272 </para>
@@ -2822,19 +2822,19 @@
2822 2822
2823 <sect1 id="run-parts"> 2823 <sect1 id="run-parts">
2824 <title>run-parts</title> 2824 <title>run-parts</title>
2825 2825
2826 <para> 2826 <para>
2827 Usage: run-parts [-t] [-a ARG] [-u MASK] DIRECTORY 2827 Usage: run-parts [-t] [-a ARG] [-u MASK] DIRECTORY
2828 </para> 2828 </para>
2829 2829
2830 <para> 2830 <para>
2831 Run a bunch of scripts in a directory. 2831 Run a bunch of scripts in a directory.
2832 </para> 2832 </para>
2833 2833
2834 <para> 2834 <para>
2835 Options: 2835 Options:
2836 </para> 2836 </para>
2837 2837
2838 <para> 2838 <para>
2839 <screen> 2839 <screen>
2840 -t Test only. It only print the file to be executed, 2840 -t Test only. It only print the file to be executed,
@@ -2844,9 +2844,9 @@
2844 </screen> 2844 </screen>
2845 </para> 2845 </para>
2846 </sect1> 2846 </sect1>
2847
2848 2847
2849 2848
2849
2850 <sect1 id="sed"> 2850 <sect1 id="sed">
2851 <title>sed</title> 2851 <title>sed</title>
2852 2852
@@ -2962,7 +2962,7 @@
2962 </para> 2962 </para>
2963 2963
2964 <para> 2964 <para>
2965 This command does not yet have proper documentation. 2965 This command does not yet have proper documentation.
2966 </para> 2966 </para>
2967 2967
2968 <para> 2968 <para>
@@ -3182,7 +3182,7 @@
3182 </para> 3182 </para>
3183 3183
3184 <para> 3184 <para>
3185 3185
3186 </para> 3186 </para>
3187 3187
3188 <para> 3188 <para>
@@ -3445,7 +3445,7 @@
3445 </para> 3445 </para>
3446 3446
3447 <para> 3447 <para>
3448 3448
3449 </para> 3449 </para>
3450 3450
3451 <para> 3451 <para>
@@ -3467,7 +3467,7 @@
3467 3467
3468 <para> 3468 <para>
3469 <screen> 3469 <screen>
3470 $ umount /dev/hdc1 3470 $ umount /dev/hdc1
3471 </screen> 3471 </screen>
3472 </para> 3472 </para>
3473 </sect1> 3473 </sect1>
@@ -3549,7 +3549,7 @@
3549 </screen> 3549 </screen>
3550 </para> 3550 </para>
3551 </sect1> 3551 </sect1>
3552 3552
3553 <sect1 id="unix2dos"> 3553 <sect1 id="unix2dos">
3554 <title>unix2dos</title> 3554 <title>unix2dos</title>
3555 3555
@@ -3869,7 +3869,7 @@
3869 </para> 3869 </para>
3870 3870
3871 <para> 3871 <para>
3872 Uncompress FILE (or stdin if FILE is '-') to stdout. 3872 Uncompress FILE (or stdin if FILE is '-') to stdout.
3873 </para> 3873 </para>
3874 3874
3875 <para> 3875 <para>
@@ -3938,7 +3938,7 @@
3938 <title>AUTHORS</title> 3938 <title>AUTHORS</title>
3939 3939
3940 <para> 3940 <para>
3941 The following people have made significant contributions to 3941 The following people have made significant contributions to
3942 BusyBox -- whether they know it or not. 3942 BusyBox -- whether they know it or not.
3943 </para> 3943 </para>
3944 3944
@@ -3963,7 +3963,7 @@
3963 </para> 3963 </para>
3964 3964
3965 <para> 3965 <para>
3966 Dave Cinege &lt;dcinege@psychosis.com&gt; 3966 Dave Cinege &lt;dcinege@psychosis.com&gt;
3967 </para> 3967 </para>
3968 3968
3969 <para> 3969 <para>
@@ -3979,7 +3979,7 @@
3979 </para> 3979 </para>
3980 3980
3981 <para> 3981 <para>
3982 John Lombardo &lt;john@deltanet.com&gt; 3982 John Lombardo &lt;john@deltanet.com&gt;
3983 </para> 3983 </para>
3984 3984
3985 <para> 3985 <para>
diff --git a/docs/busybox_header.pod b/docs/busybox_header.pod
index 047c4d067..132aa3b65 100644
--- a/docs/busybox_header.pod
+++ b/docs/busybox_header.pod
@@ -18,7 +18,7 @@ you usually find in fileutils, shellutils, findutils, textutils, grep, gzip,
18tar, etc. BusyBox provides a fairly complete POSIX environment for any small 18tar, etc. BusyBox provides a fairly complete POSIX environment for any small
19or embedded system. The utilities in BusyBox generally have fewer options than 19or embedded system. The utilities in BusyBox generally have fewer options than
20their full-featured GNU cousins; however, the options that are included provide 20their full-featured GNU cousins; however, the options that are included provide
21the expected functionality and behave very much like their GNU counterparts. 21the expected functionality and behave very much like their GNU counterparts.
22 22
23BusyBox has been written with size-optimization and limited resources in mind. 23BusyBox has been written with size-optimization and limited resources in mind.
24It is also extremely modular so you can easily include or exclude commands (or 24It is also extremely modular so you can easily include or exclude commands (or
@@ -37,19 +37,19 @@ For example, entering
37 ./ls 37 ./ls
38 38
39will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled 39will cause BusyBox to behave as 'ls' (if the 'ls' command has been compiled
40into BusyBox). 40into BusyBox).
41 41
42You can also invoke BusyBox by issuing the command as an argument on the 42You can also invoke BusyBox by issuing the command as an argument on the
43command line. For example, entering 43command line. For example, entering
44 44
45 ./BusyBox ls 45 ./BusyBox ls
46 46
47will also cause BusyBox to behave as 'ls'. 47will also cause BusyBox to behave as 'ls'.
48 48
49=head1 COMMON OPTIONS 49=head1 COMMON OPTIONS
50 50
51Most BusyBox commands support the B<-h> option to provide a 51Most BusyBox commands support the B<-h> option to provide a
52terse runtime description of their behavior. 52terse runtime description of their behavior.
53 53
54=head1 COMMANDS 54=head1 COMMANDS
55 55
diff --git a/docs/contributing.txt b/docs/contributing.txt
index 0d2f553ed..ae4ec3ef7 100644
--- a/docs/contributing.txt
+++ b/docs/contributing.txt
@@ -116,7 +116,7 @@ Bug Reporting
116If you find bugs, please submit a detailed bug report to the busybox mailing 116If you find bugs, please submit a detailed bug report to the busybox mailing
117list at busybox@busybox.net. A well-written bug report should include a 117list at busybox@busybox.net. A well-written bug report should include a
118transcript of a shell session that demonstrates the bad behavior and enables 118transcript of a shell session that demonstrates the bad behavior and enables
119anyone else to duplicate the bug on their own machine. The following is such 119anyone else to duplicate the bug on their own machine. The following is such
120an example: 120an example:
121 121
122 To: busybox@busybox.net 122 To: busybox@busybox.net
@@ -137,7 +137,7 @@ an example:
137 $ date 137 $ date
138 llegal instruction 138 llegal instruction
139 139
140 I am using Debian unstable, kernel version 2.4.19-rmk1 on an Netwinder, 140 I am using Debian unstable, kernel version 2.4.19-rmk1 on an Netwinder,
141 and the latest uClibc from CVS. Thanks for the wonderful program! 141 and the latest uClibc from CVS. Thanks for the wonderful program!
142 142
143 -Diligent 143 -Diligent
@@ -231,7 +231,7 @@ These are dirty jobs, but somebody's gotta do 'em.
231 231
232 - "Ten Commandments" compliance: (this is a "maybe", certainly not as 232 - "Ten Commandments" compliance: (this is a "maybe", certainly not as
233 important as any of the previous items.) 233 important as any of the previous items.)
234 http://www.lysator.liu.se/c/ten-commandments.html 234 http://www.lysator.liu.se/c/ten-commandments.html
235 235
236Other useful links: 236Other useful links:
237 237
diff --git a/docs/new-applet-HOWTO.txt b/docs/new-applet-HOWTO.txt
index 54940957c..2fc95d36d 100644
--- a/docs/new-applet-HOWTO.txt
+++ b/docs/new-applet-HOWTO.txt
@@ -106,7 +106,7 @@ config CONFIG_MU
106Usage String(s) 106Usage String(s)
107--------------- 107---------------
108 108
109Next, add usage information for you applet to include/usage.h. 109Next, add usage information for you applet to include/usage.h.
110This should look like the following: 110This should look like the following:
111 111
112 #define mu_trivial_usage \ 112 #define mu_trivial_usage \
@@ -126,8 +126,8 @@ currently exist in usage.h.)
126Header Files 126Header Files
127------------ 127------------
128 128
129Next, add an entry to include/applets.h. Be *sure* to keep the list 129Next, add an entry to include/applets.h. Be *sure* to keep the list
130in alphabetical order, or else it will break the binary-search lookup 130in alphabetical order, or else it will break the binary-search lookup
131algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily: 131algorithm in busybox.c and the Gods of BusyBox smite you. Yea, verily:
132 132
133 /* all programs above here are alphabetically "less than" 'mu' */ 133 /* all programs above here are alphabetically "less than" 'mu' */
@@ -154,10 +154,10 @@ Adding some text to docs/Configure.help is a nice start.
154The Grand Announcement 154The Grand Announcement
155---------------------- 155----------------------
156 156
157Then create a diff -urN of the files you added (<appletdir/><applet>.c, 157Then create a diff -urN of the files you added (<appletdir/><applet>.c,
158include/usage.c, include/applets.h, include/config.h, <appletdir>/Makefile.in, <appletdir>/config.in) 158include/usage.c, include/applets.h, include/config.h, <appletdir>/Makefile.in, <appletdir>/config.in)
159and send it to the mailing list: 159and send it to the mailing list:
160busybox@busybox.net. 160busybox@busybox.net.
161 161
162Sending patches as attachments is preferred, but not required. 162Sending patches as attachments is preferred, but not required.
163 163
diff --git a/docs/style-guide.txt b/docs/style-guide.txt
index 25c676ca2..915d9b27d 100644
--- a/docs/style-guide.txt
+++ b/docs/style-guide.txt
@@ -266,7 +266,7 @@ these steps:
266 conversion. 266 conversion.
267 267
268 - Compile and see if everything still works. 268 - Compile and see if everything still works.
269 269
270Please be aware of changes that have cascading effects into other files. For 270Please be aware of changes that have cascading effects into other files. For
271example, if you're changing the name of something in, say utility.c, you 271example, if you're changing the name of something in, say utility.c, you
272should probably run 'examples/mk2knr.pl utility.c' at first, but when you run 272should probably run 'examples/mk2knr.pl utility.c' at first, but when you run
@@ -293,13 +293,13 @@ Use 'const <type> var' for declaring constants.
293 #define var 80 293 #define var 80
294 294
295 Do this instead, when the variable is in a header file and will be used in 295 Do this instead, when the variable is in a header file and will be used in
296 several source files: 296 several source files:
297 297
298 const int var = 80; 298 const int var = 80;
299 299
300 Or do this when the variable is used only in a single source file: 300 Or do this when the variable is used only in a single source file:
301 301
302 static const int var = 80; 302 static const int var = 80;
303 303
304Declaring variables as '[static] const' gives variables an actual type and 304Declaring variables as '[static] const' gives variables an actual type and
305makes the compiler do type checking for you; the preprocessor does _no_ type 305makes the compiler do type checking for you; the preprocessor does _no_ type
@@ -336,7 +336,7 @@ The Folly of #ifdef
336Code cluttered with ifdefs is difficult to read and maintain. Don't do it. 336Code cluttered with ifdefs is difficult to read and maintain. Don't do it.
337Instead, put your ifdefs at the top of your .c file (or in a header), and 337Instead, put your ifdefs at the top of your .c file (or in a header), and
338conditionally define 'static inline' functions, (or *maybe* macros), which are 338conditionally define 'static inline' functions, (or *maybe* macros), which are
339used in the code. 339used in the code.
340 340
341 Don't do this: 341 Don't do this:
342 342
@@ -650,7 +650,7 @@ line in the midst of your #includes:
650And a code block similar to the following near the top of your applet_main() 650And a code block similar to the following near the top of your applet_main()
651routine: 651routine:
652 652
653 while ((opt = getopt(argc, argv, "abc")) > 0) { 653 while ((opt = getopt(argc, argv, "abc")) > 0) {
654 switch (opt) { 654 switch (opt) {
655 case 'a': 655 case 'a':
656 do_a_opt = 1; 656 do_a_opt = 1;
diff --git a/editors/Config.in b/editors/Config.in
index e2055cede..bb0285976 100644
--- a/editors/Config.in
+++ b/editors/Config.in
@@ -38,7 +38,7 @@ config CONFIG_VI
38 default n 38 default n
39 help 39 help
40 'vi' is a text editor. More specifically, it is the One True 40 'vi' is a text editor. More specifically, it is the One True
41 text editor <grin>. It does, however, have a rather steep 41 text editor <grin>. It does, however, have a rather steep
42 learning curve. If you are not already comfortable with 'vi' 42 learning curve. If you are not already comfortable with 'vi'
43 you may wish to use something else. 43 you may wish to use something else.
44 44
diff --git a/editors/Makefile b/editors/Makefile
index 00ef6d502..1c8223124 100644
--- a/editors/Makefile
+++ b/editors/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/editors/Makefile.in b/editors/Makefile.in
index 97450479d..017f30934 100644
--- a/editors/Makefile.in
+++ b/editors/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/editors/awk.c b/editors/awk.c
index 09fb41d68..cb74a9832 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -378,7 +378,7 @@ static unsigned long tokeninfo[] = {
378}; 378};
379 379
380/* internal variable names and their initial values */ 380/* internal variable names and their initial values */
381/* asterisk marks SPECIAL vars; $ is just no-named Field0 */ 381/* asterisk marks SPECIAL vars; $ is just no-named Field0 */
382enum { 382enum {
383 CONVFMT=0, OFMT, FS, OFS, 383 CONVFMT=0, OFMT, FS, OFS,
384 ORS, RS, RT, FILENAME, 384 ORS, RS, RT, FILENAME,
@@ -390,7 +390,7 @@ enum {
390 390
391static char * vNames = 391static char * vNames =
392 "CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0" 392 "CONVFMT\0" "OFMT\0" "FS\0*" "OFS\0"
393 "ORS\0" "RS\0*" "RT\0" "FILENAME\0" 393 "ORS\0" "RS\0*" "RT\0" "FILENAME\0"
394 "SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0" 394 "SUBSEP\0" "ARGIND\0" "ARGC\0" "ARGV\0"
395 "ERRNO\0" "FNR\0" 395 "ERRNO\0" "FNR\0"
396 "NR\0" "NF\0*" "IGNORECASE\0*" 396 "NR\0" "NF\0*" "IGNORECASE\0*"
@@ -486,7 +486,7 @@ static unsigned int hashidx(char *name) {
486static xhash *hash_init(void) { 486static xhash *hash_init(void) {
487 487
488 xhash *newhash; 488 xhash *newhash;
489 489
490 newhash = (xhash *)xcalloc(1, sizeof(xhash)); 490 newhash = (xhash *)xcalloc(1, sizeof(xhash));
491 newhash->csize = FIRST_PRIME; 491 newhash->csize = FIRST_PRIME;
492 newhash->items = (hash_item **)xcalloc(newhash->csize, sizeof(hash_item *)); 492 newhash->items = (hash_item **)xcalloc(newhash->csize, sizeof(hash_item *));
@@ -1053,7 +1053,7 @@ static node *parse_expr(unsigned long iexp) {
1053 /* for binary and postfix-unary operators, jump back over 1053 /* for binary and postfix-unary operators, jump back over
1054 * previous operators with higher priority */ 1054 * previous operators with higher priority */
1055 vn = cn; 1055 vn = cn;
1056 while ( ((t.info & PRIMASK) > (vn->a.n->info & PRIMASK2)) || 1056 while ( ((t.info & PRIMASK) > (vn->a.n->info & PRIMASK2)) ||
1057 ((t.info == vn->info) && ((t.info & OPCLSMASK) == OC_COLON)) ) 1057 ((t.info == vn->info) && ((t.info & OPCLSMASK) == OC_COLON)) )
1058 vn = vn->a.n; 1058 vn = vn->a.n;
1059 if ((t.info & OPCLSMASK) == OC_TERNARY) 1059 if ((t.info & OPCLSMASK) == OC_TERNARY)
@@ -1085,7 +1085,7 @@ static node *parse_expr(unsigned long iexp) {
1085 xtc = TC_OPERAND | TC_UOPPRE | TC_REGEXP; 1085 xtc = TC_OPERAND | TC_UOPPRE | TC_REGEXP;
1086 if (tc & (TC_OPERAND | TC_REGEXP)) { 1086 if (tc & (TC_OPERAND | TC_REGEXP)) {
1087 xtc = TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp; 1087 xtc = TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp;
1088 /* one should be very careful with switch on tclass - 1088 /* one should be very careful with switch on tclass -
1089 * only simple tclasses should be used! */ 1089 * only simple tclasses should be used! */
1090 switch (tc) { 1090 switch (tc) {
1091 case TC_VARIABLE: 1091 case TC_VARIABLE:
@@ -1103,7 +1103,7 @@ static node *parse_expr(unsigned long iexp) {
1103 } 1103 }
1104 xtc = TC_UOPPOST | TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp; 1104 xtc = TC_UOPPOST | TC_UOPPRE | TC_BINOP | TC_OPERAND | iexp;
1105 break; 1105 break;
1106 1106
1107 case TC_NUMBER: 1107 case TC_NUMBER:
1108 case TC_STRING: 1108 case TC_STRING:
1109 cn->info = OC_VAR; 1109 cn->info = OC_VAR;
@@ -1763,7 +1763,7 @@ static char *awk_printf(node *n) {
1763 s = f; 1763 s = f;
1764 while (*f && (*f != '%' || *(++f) == '%')) 1764 while (*f && (*f != '%' || *(++f) == '%'))
1765 f++; 1765 f++;
1766 while (*f && !isalpha(*f)) 1766 while (*f && !isalpha(*f))
1767 f++; 1767 f++;
1768 1768
1769 incr = (f - s) + MAXVARFMT; 1769 incr = (f - s) + MAXVARFMT;
diff --git a/editors/patch.c b/editors/patch.c
index 1587919bc..e3745ef39 100644
--- a/editors/patch.c
+++ b/editors/patch.c
@@ -31,7 +31,7 @@
31 * - Non-interactive 31 * - Non-interactive
32 * - Patches must apply cleanly or the hunk will fail. 32 * - Patches must apply cleanly or the hunk will fail.
33 * - Reject file isnt saved 33 * - Reject file isnt saved
34 * - 34 * -
35 */ 35 */
36 36
37#include <getopt.h> 37#include <getopt.h>
@@ -55,7 +55,7 @@ static int copy_lines(FILE *src_stream, FILE *dest_stream, const unsigned int li
55 bb_perror_msg_and_die("Error writing to new file"); 55 bb_perror_msg_and_die("Error writing to new file");
56 } 56 }
57 free(line); 57 free(line);
58 58
59 i++; 59 i++;
60 } 60 }
61 return(i); 61 return(i);
@@ -282,7 +282,7 @@ extern int patch_main(int argc, char **argv)
282 } 282 }
283 } 283 }
284 284
285 /* 0 = SUCCESS 285 /* 0 = SUCCESS
286 * 1 = Some hunks failed 286 * 1 = Some hunks failed
287 * 2 = More serious problems 287 * 2 = More serious problems
288 */ 288 */
diff --git a/editors/sed.c b/editors/sed.c
index a7c99a16b..c97092a5c 100644
--- a/editors/sed.c
+++ b/editors/sed.c
@@ -209,7 +209,7 @@ static char *copy_parsing_slashn(const char *string, int len)
209/* 209/*
210 * index_of_next_unescaped_regexp_delim - walks left to right through a string 210 * index_of_next_unescaped_regexp_delim - walks left to right through a string
211 * beginning at a specified index and returns the index of the next regular 211 * beginning at a specified index and returns the index of the next regular
212 * expression delimiter (typically a forward * slash ('/')) not preceeded by 212 * expression delimiter (typically a forward * slash ('/')) not preceeded by
213 * a backslash ('\'). 213 * a backslash ('\').
214 */ 214 */
215static int index_of_next_unescaped_regexp_delim(const char delimiter, 215static int index_of_next_unescaped_regexp_delim(const char delimiter,
@@ -294,7 +294,7 @@ static int get_address(char *my_str, int *linenum, regex_t ** regex)
294 next = index_of_next_unescaped_regexp_delim(delimiter, ++pos); 294 next = index_of_next_unescaped_regexp_delim(delimiter, ++pos);
295 if (next == -1) 295 if (next == -1)
296 bb_error_msg_and_die("unterminated match expression"); 296 bb_error_msg_and_die("unterminated match expression");
297 297
298 temp=copy_parsing_slashn(pos,next); 298 temp=copy_parsing_slashn(pos,next);
299 *regex = (regex_t *) xmalloc(sizeof(regex_t)); 299 *regex = (regex_t *) xmalloc(sizeof(regex_t));
300 xregcomp(*regex, temp, REG_NEWLINE); 300 xregcomp(*regex, temp, REG_NEWLINE);
@@ -372,7 +372,7 @@ static int parse_subst_cmd(sed_cmd_t * const sed_cmd, char *substr)
372 { 372 {
373 char *temp; 373 char *temp;
374 idx+=parse_file_cmd(sed_cmd,substr+idx,&temp); 374 idx+=parse_file_cmd(sed_cmd,substr+idx,&temp);
375 375
376 break; 376 break;
377 } 377 }
378 /* Ignore case (gnu exension) */ 378 /* Ignore case (gnu exension) */
diff --git a/editors/vi.c b/editors/vi.c
index 1932742ec..28eca754a 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21static const char vi_Version[] = 21static const char vi_Version[] =
22 "$Id: vi.c,v 1.33 2004/02/06 10:36:08 andersen Exp $"; 22 "$Id: vi.c,v 1.34 2004/03/15 08:28:32 andersen Exp $";
23 23
24/* 24/*
25 * To compile for standalone use: 25 * To compile for standalone use:
@@ -2548,14 +2548,14 @@ static void place_cursor(int row, int col, int opti)
2548 // char cm3[BUFSIZ]; 2548 // char cm3[BUFSIZ];
2549 int Rrow= last_row; 2549 int Rrow= last_row;
2550#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */ 2550#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */
2551 2551
2552 memset(cm1, '\0', BUFSIZ - 1); // clear the buffer 2552 memset(cm1, '\0', BUFSIZ - 1); // clear the buffer
2553 2553
2554 if (row < 0) row = 0; 2554 if (row < 0) row = 0;
2555 if (row >= rows) row = rows - 1; 2555 if (row >= rows) row = rows - 1;
2556 if (col < 0) col = 0; 2556 if (col < 0) col = 0;
2557 if (col >= columns) col = columns - 1; 2557 if (col >= columns) col = columns - 1;
2558 2558
2559 //----- 1. Try the standard terminal ESC sequence 2559 //----- 1. Try the standard terminal ESC sequence
2560 sprintf((char *) cm1, CMrc, row + 1, col + 1); 2560 sprintf((char *) cm1, CMrc, row + 1, col + 1);
2561 cm= cm1; 2561 cm= cm1;
@@ -2565,7 +2565,7 @@ static void place_cursor(int row, int col, int opti)
2565 //----- find the minimum # of chars to move cursor ------------- 2565 //----- find the minimum # of chars to move cursor -------------
2566 //----- 2. Try moving with discreet chars (Newline, [back]space, ...) 2566 //----- 2. Try moving with discreet chars (Newline, [back]space, ...)
2567 memset(cm2, '\0', BUFSIZ - 1); // clear the buffer 2567 memset(cm2, '\0', BUFSIZ - 1); // clear the buffer
2568 2568
2569 // move to the correct row 2569 // move to the correct row
2570 while (row < Rrow) { 2570 while (row < Rrow) {
2571 // the cursor has to move up 2571 // the cursor has to move up
@@ -2577,7 +2577,7 @@ static void place_cursor(int row, int col, int opti)
2577 strcat(cm2, CMdown); 2577 strcat(cm2, CMdown);
2578 Rrow++; 2578 Rrow++;
2579 } 2579 }
2580 2580
2581 // now move to the correct column 2581 // now move to the correct column
2582 strcat(cm2, "\r"); // start at col 0 2582 strcat(cm2, "\r"); // start at col 0
2583 // just send out orignal source char to get to correct place 2583 // just send out orignal source char to get to correct place
@@ -2748,7 +2748,7 @@ static void format_line(Byte *dest, Byte *src, int li)
2748{ 2748{
2749 int co; 2749 int co;
2750 Byte c; 2750 Byte c;
2751 2751
2752 for (co= 0; co < MAX_SCR_COLS; co++) { 2752 for (co= 0; co < MAX_SCR_COLS; co++) {
2753 c= ' '; // assume blank 2753 c= ' '; // assume blank
2754 if (li > 0 && co == 0) { 2754 if (li > 0 && co == 0) {
@@ -2899,7 +2899,7 @@ static void refresh(int full_screen)
2899#else 2899#else
2900 place_cursor(crow, ccol, FALSE); 2900 place_cursor(crow, ccol, FALSE);
2901#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */ 2901#endif /* CONFIG_FEATURE_VI_OPTIMIZE_CURSOR */
2902 2902
2903 if (offset != old_offset) 2903 if (offset != old_offset)
2904 old_offset = offset; 2904 old_offset = offset;
2905} 2905}
@@ -2997,29 +2997,29 @@ key_cmd_mode:
2997 //case 0x1d: // gs 2997 //case 0x1d: // gs
2998 //case 0x1e: // rs 2998 //case 0x1e: // rs
2999 //case 0x1f: // us 2999 //case 0x1f: // us
3000 //case '!': // !- 3000 //case '!': // !-
3001 //case '#': // #- 3001 //case '#': // #-
3002 //case '&': // &- 3002 //case '&': // &-
3003 //case '(': // (- 3003 //case '(': // (-
3004 //case ')': // )- 3004 //case ')': // )-
3005 //case '*': // *- 3005 //case '*': // *-
3006 //case ',': // ,- 3006 //case ',': // ,-
3007 //case '=': // =- 3007 //case '=': // =-
3008 //case '@': // @- 3008 //case '@': // @-
3009 //case 'F': // F- 3009 //case 'F': // F-
3010 //case 'K': // K- 3010 //case 'K': // K-
3011 //case 'Q': // Q- 3011 //case 'Q': // Q-
3012 //case 'S': // S- 3012 //case 'S': // S-
3013 //case 'T': // T- 3013 //case 'T': // T-
3014 //case 'V': // V- 3014 //case 'V': // V-
3015 //case '[': // [- 3015 //case '[': // [-
3016 //case '\\': // \- 3016 //case '\\': // \-
3017 //case ']': // ]- 3017 //case ']': // ]-
3018 //case '_': // _- 3018 //case '_': // _-
3019 //case '`': // `- 3019 //case '`': // `-
3020 //case 'g': // g- 3020 //case 'g': // g-
3021 //case 'u': // u- FIXME- there is no undo 3021 //case 'u': // u- FIXME- there is no undo
3022 //case 'v': // v- 3022 //case 'v': // v-
3023 default: // unrecognised command 3023 default: // unrecognised command
3024 buf[0] = c; 3024 buf[0] = c;
3025 buf[1] = '\0'; 3025 buf[1] = '\0';
@@ -3338,15 +3338,15 @@ key_cmd_mode:
3338 break; 3338 break;
3339#endif /* CONFIG_FEATURE_VI_SEARCH */ 3339#endif /* CONFIG_FEATURE_VI_SEARCH */
3340 case '0': // 0- goto begining of line 3340 case '0': // 0- goto begining of line
3341 case '1': // 1- 3341 case '1': // 1-
3342 case '2': // 2- 3342 case '2': // 2-
3343 case '3': // 3- 3343 case '3': // 3-
3344 case '4': // 4- 3344 case '4': // 4-
3345 case '5': // 5- 3345 case '5': // 5-
3346 case '6': // 6- 3346 case '6': // 6-
3347 case '7': // 7- 3347 case '7': // 7-
3348 case '8': // 8- 3348 case '8': // 8-
3349 case '9': // 9- 3349 case '9': // 9-
3350 if (c == '0' && cmdcnt < 1) { 3350 if (c == '0' && cmdcnt < 1) {
3351 dot_begin(); // this was a standalone zero 3351 dot_begin(); // this was a standalone zero
3352 } else { 3352 } else {
diff --git a/examples/bootfloppy/bootfloppy.txt b/examples/bootfloppy/bootfloppy.txt
index 090ef0499..16f2c130f 100644
--- a/examples/bootfloppy/bootfloppy.txt
+++ b/examples/bootfloppy/bootfloppy.txt
@@ -38,13 +38,13 @@ Making a Root File System
38The following steps will create a root file system. 38The following steps will create a root file system.
39 39
40 - Create an empty file that you can format as a filesystem: 40 - Create an empty file that you can format as a filesystem:
41 41
42 dd if=/dev/zero of=rootfs bs=1k count=4000 42 dd if=/dev/zero of=rootfs bs=1k count=4000
43 43
44 - Set up the rootfs file we just created to be used as a loop device (may not 44 - Set up the rootfs file we just created to be used as a loop device (may not
45 be necessary) 45 be necessary)
46 46
47 losetup /dev/loop0 rootfs 47 losetup /dev/loop0 rootfs
48 48
49 - Format the rootfs file with a filesystem: 49 - Format the rootfs file with a filesystem:
50 50
@@ -101,15 +101,15 @@ The following steps will create the boot floppy.
101Note: You will need to have the mtools package installed beforehand. 101Note: You will need to have the mtools package installed beforehand.
102 102
103 - Insert a floppy in the drive and format it with an MSDOS filesystem: 103 - Insert a floppy in the drive and format it with an MSDOS filesystem:
104 104
105 mformat a: 105 mformat a:
106 106
107 (if the system doesn't know what device 'a:' is, look at /etc/mtools.conf) 107 (if the system doesn't know what device 'a:' is, look at /etc/mtools.conf)
108 108
109 - Run syslinux on the floppy: 109 - Run syslinux on the floppy:
110 110
111 syslinux -s /dev/fd0 111 syslinux -s /dev/fd0
112 112
113 (the -s stands for "safe, slow, and stupid" and should work better with 113 (the -s stands for "safe, slow, and stupid" and should work better with
114 buggy BIOSes; it can be omitted) 114 buggy BIOSes; it can be omitted)
115 115
diff --git a/examples/bootfloppy/etc/profile b/examples/bootfloppy/etc/profile
index e9b11e90a..8a7c77d78 100644
--- a/examples/bootfloppy/etc/profile
+++ b/examples/bootfloppy/etc/profile
@@ -4,5 +4,5 @@ echo
4echo -n "Processing /etc/profile... " 4echo -n "Processing /etc/profile... "
5# no-op 5# no-op
6echo "Done" 6echo "Done"
7echo 7echo
8 8
diff --git a/examples/bootfloppy/mkrootfs.sh b/examples/bootfloppy/mkrootfs.sh
index e56d10469..e79ed418e 100755
--- a/examples/bootfloppy/mkrootfs.sh
+++ b/examples/bootfloppy/mkrootfs.sh
@@ -63,10 +63,10 @@ mount -o loop,exec rootfs $TARGET_DIR # must be root
63# install uClibc 63# install uClibc
64mkdir -p $TARGET_DIR/lib 64mkdir -p $TARGET_DIR/lib
65cd $UCLIBC_DIR 65cd $UCLIBC_DIR
66make INSTALL_DIR= 66make INSTALL_DIR=
67cp -a libc.so* $BASE_DIR/$TARGET_DIR/lib 67cp -a libc.so* $BASE_DIR/$TARGET_DIR/lib
68cp -a uClibc*.so $BASE_DIR/$TARGET_DIR/lib 68cp -a uClibc*.so $BASE_DIR/$TARGET_DIR/lib
69cp -a ld.so-1/d-link/ld-linux-uclibc.so* $BASE_DIR/$TARGET_DIR/lib 69cp -a ld.so-1/d-link/ld-linux-uclibc.so* $BASE_DIR/$TARGET_DIR/lib
70cp -a ld.so-1/libdl/libdl.so* $BASE_DIR/$TARGET_DIR/lib 70cp -a ld.so-1/libdl/libdl.so* $BASE_DIR/$TARGET_DIR/lib
71cp -a crypt/libcrypt.so* $BASE_DIR/$TARGET_DIR/lib 71cp -a crypt/libcrypt.so* $BASE_DIR/$TARGET_DIR/lib
72cd $BASE_DIR 72cd $BASE_DIR
diff --git a/examples/bootfloppy/syslinux.cfg b/examples/bootfloppy/syslinux.cfg
index 8d407cad4..fa2677ca8 100644
--- a/examples/bootfloppy/syslinux.cfg
+++ b/examples/bootfloppy/syslinux.cfg
@@ -4,4 +4,4 @@ timeout 10
4prompt 1 4prompt 1
5label linux 5label linux
6 kernel linux 6 kernel linux
7 append initrd=rootfs.gz root=/dev/ram0 7 append initrd=rootfs.gz root=/dev/ram0
diff --git a/examples/busybox.spec b/examples/busybox.spec
index 188b09b29..3986436c1 100644
--- a/examples/busybox.spec
+++ b/examples/busybox.spec
@@ -39,6 +39,6 @@ make PREFIX=$RPM_BUILD_ROOT install
39%Clean 39%Clean
40rm -rf $RPM_BUILD_ROOT 40rm -rf $RPM_BUILD_ROOT
41 41
42%Files 42%Files
43%defattr(-,root,root) 43%defattr(-,root,root)
44/ 44/
diff --git a/examples/depmod.pl b/examples/depmod.pl
index ea29e8883..9af192208 100755
--- a/examples/depmod.pl
+++ b/examples/depmod.pl
@@ -4,7 +4,7 @@
4# Copyright (c) 2001 Erik Andersen <andersen@codepoet.org> 4# Copyright (c) 2001 Erik Andersen <andersen@codepoet.org>
5# Copyright (c) 2001 Stuart Hughes <stuarth@lineo.com> 5# Copyright (c) 2001 Stuart Hughes <stuarth@lineo.com>
6# Copyright (c) 2002 Steven J. Hill <shill@broadcom.com> 6# Copyright (c) 2002 Steven J. Hill <shill@broadcom.com>
7# This program is free software; you can redistribute it and/or modify it 7# This program is free software; you can redistribute it and/or modify it
8# under the same terms as Perl itself. 8# under the same terms as Perl itself.
9 9
10# TODO -- use strict mode... 10# TODO -- use strict mode...
@@ -54,13 +54,13 @@ if($basedir !~ m-/lib/modules-) {
54 warn "WARNING: base directory does not match ..../lib/modules\n"; 54 warn "WARNING: base directory does not match ..../lib/modules\n";
55} 55}
56 56
57# Find the list of .o files living under $basedir 57# Find the list of .o files living under $basedir
58#if ($verbose) { printf "Locating all modules\n"; } 58#if ($verbose) { printf "Locating all modules\n"; }
59my($ofile) = ""; 59my($ofile) = "";
60my($file) = ""; 60my($file) = "";
61my(@liblist) = (); 61my(@liblist) = ();
62find sub { 62find sub {
63 if ( -f $_ && ! -d $_ ) { 63 if ( -f $_ && ! -d $_ ) {
64 $file = $File::Find::name; 64 $file = $File::Find::name;
65 if ( $file =~ /.o$/ ) { 65 if ( $file =~ /.o$/ ) {
66 push(@liblist, $file); 66 push(@liblist, $file);
@@ -118,14 +118,14 @@ foreach $obj ( @liblist, $kernel ){
118foreach $module (keys %$dep) { 118foreach $module (keys %$dep) {
119 $mod->{$module} = {}; 119 $mod->{$module} = {};
120 foreach (@{$dep->{$module}}) { 120 foreach (@{$dep->{$module}}) {
121 if( $exp->{$_} ) { 121 if( $exp->{$_} ) {
122 warn "resolved symbol $_ in file $exp->{$_}\n" if $verbose; 122 warn "resolved symbol $_ in file $exp->{$_}\n" if $verbose;
123 next if $exp->{$_} =~ /vmlinux/; 123 next if $exp->{$_} =~ /vmlinux/;
124 $mod->{$module}{$exp->{$_}} = 1; 124 $mod->{$module}{$exp->{$_}} = 1;
125 } else { 125 } else {
126 warn "unresolved symbol $_ in file $module\n"; 126 warn "unresolved symbol $_ in file $module\n";
127 } 127 }
128 } 128 }
129} 129}
130 130
131# resolve the dependancies for each module 131# resolve the dependancies for each module
@@ -222,9 +222,9 @@ Be verbose (not implemented)
222=head1 COPYRIGHT 222=head1 COPYRIGHT
223 223
224Copyright (c) 2001 David Schleef <ds@schleef.org> 224Copyright (c) 2001 David Schleef <ds@schleef.org>
225Copyright (c) 2001 Erik Andersen <andersen@lineo.com> 225Copyright (c) 2001 Erik Andersen <andersen@codepoet.org>
226Copyright (c) 2001 Stuart Hughes <stuarth@lineo.com> 226Copyright (c) 2001 Stuart Hughes <stuarth@lineo.com>
227This program is free software; you can redistribute it and/or modify it 227This program is free software; you can redistribute it and/or modify it
228under the same terms as Perl itself. 228under the same terms as Perl itself.
229 229
230=head1 AUTHOR 230=head1 AUTHOR
@@ -233,5 +233,5 @@ David Schleef <ds@schleef.org>
233 233
234=cut 234=cut
235 235
236# $Id: depmod.pl,v 1.3 2003/07/14 21:20:51 andersen Exp $ 236# $Id: depmod.pl,v 1.4 2004/03/15 08:28:33 andersen Exp $
237 237
diff --git a/examples/inittab b/examples/inittab
index 38df92497..ce711ac6c 100644
--- a/examples/inittab
+++ b/examples/inittab
@@ -1,6 +1,6 @@
1# /etc/inittab init(8) configuration for BusyBox 1# /etc/inittab init(8) configuration for BusyBox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# 5#
6# Note, BusyBox init doesn't support runlevels. The runlevels field is 6# Note, BusyBox init doesn't support runlevels. The runlevels field is
@@ -22,7 +22,7 @@
22# 22#
23# <runlevels>: The runlevels field is completely ignored. 23# <runlevels>: The runlevels field is completely ignored.
24# 24#
25# <action>: Valid actions include: sysinit, respawn, askfirst, wait, once, 25# <action>: Valid actions include: sysinit, respawn, askfirst, wait, once,
26# restart, ctrlaltdel, and shutdown. 26# restart, ctrlaltdel, and shutdown.
27# 27#
28# Note: askfirst acts just like respawn, but before running the specified 28# Note: askfirst acts just like respawn, but before running the specified
diff --git a/examples/udhcp/udhcpd.conf b/examples/udhcp/udhcpd.conf
index 2b93e0fae..00105b3e5 100644
--- a/examples/udhcp/udhcpd.conf
+++ b/examples/udhcp/udhcpd.conf
@@ -33,7 +33,7 @@ interface eth0 #default: eth0
33#auto_time 7200 #default: 7200 (2 hours) 33#auto_time 7200 #default: 7200 (2 hours)
34 34
35 35
36# The amount of time that an IP will be reserved (leased) for if a 36# The amount of time that an IP will be reserved (leased) for if a
37# DHCP decline message is received (seconds). 37# DHCP decline message is received (seconds).
38 38
39#decline_time 3600 #default: 3600 (1 hour) 39#decline_time 3600 #default: 3600 (1 hour)
diff --git a/examples/undeb b/examples/undeb
index a72e1e2ba..37104e9d8 100644
--- a/examples/undeb
+++ b/examples/undeb
@@ -8,12 +8,12 @@ usage() {
8echo "Usage: undeb -c package.deb <Print control file info>" 8echo "Usage: undeb -c package.deb <Print control file info>"
9echo " undeb -l package.deb <List contents of deb package>" 9echo " undeb -l package.deb <List contents of deb package>"
10echo " undeb -x package.deb /foo/boo <Extract deb package to this directory," 10echo " undeb -x package.deb /foo/boo <Extract deb package to this directory,"
11echo " put . for current directory>" 11echo " put . for current directory>"
12exit 12exit
13} 13}
14 14
15deb=$2 15deb=$2
16 16
17exist() { 17exist() {
18if [ "$deb" = "" ]; then 18if [ "$deb" = "" ]; then
19usage 19usage
@@ -30,11 +30,11 @@ exist
30type more >/dev/null 2>&1 && pager=more 30type more >/dev/null 2>&1 && pager=more
31type less >/dev/null 2>&1 && pager=less 31type less >/dev/null 2>&1 && pager=less
32[ "$pager" = "" ] && echo "No pager found!" && exit 32[ "$pager" = "" ] && echo "No pager found!" && exit
33(ar -p $deb control.tar.gz | tar -xzO *control ; echo -e "\nPress enter to scroll, q to Quit!\n" ; ar -p $deb data.tar.gz | tar -tzv) | $pager 33(ar -p $deb control.tar.gz | tar -xzO *control ; echo -e "\nPress enter to scroll, q to Quit!\n" ; ar -p $deb data.tar.gz | tar -tzv) | $pager
34exit 34exit
35elif [ "$1" = "-c" ]; then 35elif [ "$1" = "-c" ]; then
36exist 36exist
37ar -p $deb control.tar.gz | tar -xzO *control 37ar -p $deb control.tar.gz | tar -xzO *control
38exit 38exit
39elif [ "$1" = "-x" ]; then 39elif [ "$1" = "-x" ]; then
40exist 40exist
@@ -44,7 +44,7 @@ elif [ ! -d "$3" ]; then
44echo "No such directory $3!" 44echo "No such directory $3!"
45exit 45exit
46fi 46fi
47ar -p $deb data.tar.gz | tar -xzvpf - -C $3 || exit 47ar -p $deb data.tar.gz | tar -xzvpf - -C $3 || exit
48echo 48echo
49echo "Extracted $deb to $3!" 49echo "Extracted $deb to $3!"
50exit 50exit
diff --git a/examples/unrpm b/examples/unrpm
index 376286a6f..7fd3676f6 100644
--- a/examples/unrpm
+++ b/examples/unrpm
@@ -7,12 +7,12 @@
7usage() { 7usage() {
8echo "Usage: unrpm -l package.rpm <List contents of rpm package>" 8echo "Usage: unrpm -l package.rpm <List contents of rpm package>"
9echo " unrpm -x package.rpm /foo/boo <Extract rpm package to this directory," 9echo " unrpm -x package.rpm /foo/boo <Extract rpm package to this directory,"
10echo " put . for current directory>" 10echo " put . for current directory>"
11exit 11exit
12} 12}
13 13
14rpm=$2 14rpm=$2
15 15
16exist() { 16exist() {
17if [ "$rpm" = "" ]; then 17if [ "$rpm" = "" ]; then
18usage 18usage
diff --git a/findutils/Config.in b/findutils/Config.in
index a432ad876..3143bd438 100644
--- a/findutils/Config.in
+++ b/findutils/Config.in
@@ -95,7 +95,7 @@ config CONFIG_XARGS
95 default n 95 default n
96 help 96 help
97 xargs is used to execute a specified command on 97 xargs is used to execute a specified command on
98 every item from standard input. 98 every item from standard input.
99 99
100config CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION 100config CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
101 bool " Enable prompt and confirmation option -p" 101 bool " Enable prompt and confirmation option -p"
diff --git a/findutils/Makefile b/findutils/Makefile
index fffee8f2c..ba65a0e1d 100644
--- a/findutils/Makefile
+++ b/findutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/findutils/Makefile.in b/findutils/Makefile.in
index 6413a7fd1..2d2f242a0 100644
--- a/findutils/Makefile.in
+++ b/findutils/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/findutils/find.c b/findutils/find.c
index 661030460..11a838e9f 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini find implementation for busybox 3 * Mini find implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Reworked by David Douthitt <n9ubh@callsign.net> and 7 * Reworked by David Douthitt <n9ubh@callsign.net> and
8 * Matt Kraai <kraai@alumni.carnegiemellon.edu>. 8 * Matt Kraai <kraai@alumni.carnegiemellon.edu>.
@@ -98,7 +98,7 @@ static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
98 time_t mtime_secs = mtime_days * 24 * 60 * 60; 98 time_t mtime_secs = mtime_days * 24 * 60 * 60;
99 if (!((isdigit(mtime_char) && file_age >= mtime_secs && 99 if (!((isdigit(mtime_char) && file_age >= mtime_secs &&
100 file_age < mtime_secs + 24 * 60 * 60) || 100 file_age < mtime_secs + 24 * 60 * 60) ||
101 (mtime_char == '+' && file_age >= mtime_secs + 24 * 60 * 60) || 101 (mtime_char == '+' && file_age >= mtime_secs + 24 * 60 * 60) ||
102 (mtime_char == '-' && file_age < mtime_secs))) 102 (mtime_char == '-' && file_age < mtime_secs)))
103 goto no_match; 103 goto no_match;
104 } 104 }
@@ -234,13 +234,13 @@ int find_main(int argc, char **argv)
234 xdev_dev [0] = stbuf. st_dev; 234 xdev_dev [0] = stbuf. st_dev;
235 } 235 }
236 else { 236 else {
237 237
238 for (i = 1; i < firstopt; i++) { 238 for (i = 1; i < firstopt; i++) {
239 if ( stat ( argv [i], &stbuf ) < 0 ) 239 if ( stat ( argv [i], &stbuf ) < 0 )
240 bb_error_msg_and_die("could not stat '%s'", argv [i] ); 240 bb_error_msg_and_die("could not stat '%s'", argv [i] );
241 xdev_dev [i-1] = stbuf. st_dev; 241 xdev_dev [i-1] = stbuf. st_dev;
242 } 242 }
243 } 243 }
244#endif 244#endif
245#ifdef CONFIG_FEATURE_FIND_NEWER 245#ifdef CONFIG_FEATURE_FIND_NEWER
246 } else if (strcmp(argv[i], "-newer") == 0) { 246 } else if (strcmp(argv[i], "-newer") == 0) {
diff --git a/findutils/grep.c b/findutils/grep.c
index 241099c79..229508cda 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -2,7 +2,7 @@
2 * Mini grep implementation for busybox using libc regex. 2 * Mini grep implementation for busybox using libc regex.
3 * 3 *
4 * Copyright (C) 1999,2000,2001 by Lineo, inc. and Mark Whitley 4 * Copyright (C) 1999,2000,2001 by Lineo, inc. and Mark Whitley
5 * Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org> 5 * Copyright (C) 1999,2000,2001 by Mark Whitley <markw@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -116,7 +116,7 @@ static int grep_file(FILE *file)
116 int print_n_lines_after = 0; 116 int print_n_lines_after = 0;
117 int curpos = 0; /* track where we are in the circular 'before' buffer */ 117 int curpos = 0; /* track where we are in the circular 'before' buffer */
118 int idx = 0; /* used for iteration through the circular buffer */ 118 int idx = 0; /* used for iteration through the circular buffer */
119#endif /* CONFIG_FEATURE_GREP_CONTEXT */ 119#endif /* CONFIG_FEATURE_GREP_CONTEXT */
120 120
121 while ((line = bb_get_chomped_line_from_file(file)) != NULL) { 121 while ((line = bb_get_chomped_line_from_file(file)) != NULL) {
122 llist_t *pattern_ptr = pattern_head; 122 llist_t *pattern_ptr = pattern_head;
@@ -190,7 +190,7 @@ static int grep_file(FILE *file)
190 190
191 /* make a note that we need to print 'after' lines */ 191 /* make a note that we need to print 'after' lines */
192 print_n_lines_after = lines_after; 192 print_n_lines_after = lines_after;
193#endif /* CONFIG_FEATURE_GREP_CONTEXT */ 193#endif /* CONFIG_FEATURE_GREP_CONTEXT */
194 print_line(line, linenum, ':'); 194 print_line(line, linenum, ':');
195 } 195 }
196 } 196 }
@@ -209,7 +209,7 @@ static int grep_file(FILE *file)
209 print_line(line, linenum, '-'); 209 print_line(line, linenum, '-');
210 print_n_lines_after--; 210 print_n_lines_after--;
211 } 211 }
212#endif /* CONFIG_FEATURE_GREP_CONTEXT */ 212#endif /* CONFIG_FEATURE_GREP_CONTEXT */
213 free(line); 213 free(line);
214 } 214 }
215 215
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 8d7e813b5..16b94e20f 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -96,12 +96,12 @@ static int xargs_exec(char *const *args)
96 return 124; 96 return 124;
97 } 97 }
98 if (WIFSTOPPED(status)) { 98 if (WIFSTOPPED(status)) {
99 bb_error_msg("%s: stopped by signal %d", 99 bb_error_msg("%s: stopped by signal %d",
100 args[0], WSTOPSIG(status)); 100 args[0], WSTOPSIG(status));
101 return 125; 101 return 125;
102 } 102 }
103 if (WIFSIGNALED(status)) { 103 if (WIFSIGNALED(status)) {
104 bb_error_msg("%s: terminated by signal %d", 104 bb_error_msg("%s: terminated by signal %d",
105 args[0], WTERMSIG(status)); 105 args[0], WTERMSIG(status));
106 return 125; 106 return 125;
107 } 107 }
@@ -129,7 +129,7 @@ static int eof_stdin_detected;
129 || (c) == '\f' || (c) == '\v') 129 || (c) == '\f' || (c) == '\v')
130 130
131#ifdef CONFIG_FEATURE_XARGS_SUPPORT_QUOTES 131#ifdef CONFIG_FEATURE_XARGS_SUPPORT_QUOTES
132static xlist_t *process_stdin(xlist_t * list_arg, 132static xlist_t *process_stdin(xlist_t * list_arg,
133 const char *eof_str, size_t mc, char *buf) 133 const char *eof_str, size_t mc, char *buf)
134{ 134{
135#define NORM 0 135#define NORM 0
@@ -200,7 +200,7 @@ set:
200 } 200 }
201 if (state == SPACE) { /* word's delimiter or EOF detected */ 201 if (state == SPACE) { /* word's delimiter or EOF detected */
202 if (q) { 202 if (q) {
203 bb_error_msg_and_die("unmatched %s quote", 203 bb_error_msg_and_die("unmatched %s quote",
204 q == '\'' ? "single" : "double"); 204 q == '\'' ? "single" : "double");
205 } 205 }
206 /* word loaded */ 206 /* word loaded */
@@ -234,7 +234,7 @@ set:
234} 234}
235#else 235#else
236/* The variant does not support single quotes, double quotes or backslash */ 236/* The variant does not support single quotes, double quotes or backslash */
237static xlist_t *process_stdin(xlist_t * list_arg, 237static xlist_t *process_stdin(xlist_t * list_arg,
238 const char *eof_str, size_t mc, char *buf) 238 const char *eof_str, size_t mc, char *buf)
239{ 239{
240 240
@@ -496,8 +496,8 @@ int xargs_main(int argc, char **argv)
496 read_args = process0_stdin; 496 read_args = process0_stdin;
497#endif 497#endif
498 498
499 while ((list = READ_ARGS(list, eof_str, n_max_chars, max_chars)) != NULL || 499 while ((list = READ_ARGS(list, eof_str, n_max_chars, max_chars)) != NULL ||
500 (opt & OPT_NO_EMPTY) == 0) 500 (opt & OPT_NO_EMPTY) == 0)
501 { 501 {
502 opt |= OPT_NO_EMPTY; 502 opt |= OPT_NO_EMPTY;
503 n = 0; 503 n = 0;
@@ -574,7 +574,7 @@ const char *bb_applet_name = "debug stuff usage";
574 574
575void bb_show_usage(void) 575void bb_show_usage(void)
576{ 576{
577 fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n", 577 fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n",
578 bb_applet_name); 578 bb_applet_name);
579 exit(1); 579 exit(1);
580} 580}
diff --git a/include/busybox.h b/include/busybox.h
index ba4edcaba..f6f575957 100644
--- a/include/busybox.h
+++ b/include/busybox.h
@@ -17,7 +17,7 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 19 *
20 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell 20 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
21 * Permission has been granted to redistribute this code under the GPL. 21 * Permission has been granted to redistribute this code under the GPL.
22 * 22 *
23 */ 23 */
@@ -81,7 +81,7 @@ extern const struct BB_applet applets[];
81 * applet usage strings. These are all of the form: 81 * applet usage strings. These are all of the form:
82 * extern int foo_main(int argc, char **argv); 82 * extern int foo_main(int argc, char **argv);
83 * extern const char foo_usage[]; 83 * extern const char foo_usage[];
84 * These are all autogenerated from the set of currently defined applets. 84 * These are all autogenerated from the set of currently defined applets.
85 */ 85 */
86#define PROTOTYPES 86#define PROTOTYPES
87#include "applets.h" 87#include "applets.h"
diff --git a/include/libbb.h b/include/libbb.h
index 7814c4b8e..a01a0ca3e 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -17,7 +17,7 @@
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * 19 *
20 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell 20 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
21 * Permission has been granted to redistribute this code under the GPL. 21 * Permission has been granted to redistribute this code under the GPL.
22 * 22 *
23 */ 23 */
@@ -130,7 +130,7 @@ extern int get_kernel_revision(void);
130 130
131extern int get_console_fd(void); 131extern int get_console_fd(void);
132extern struct mntent *find_mount_point(const char *name, const char *table); 132extern struct mntent *find_mount_point(const char *name, const char *table);
133extern void write_mtab(char* blockDevice, char* directory, 133extern void write_mtab(char* blockDevice, char* directory,
134 char* filesystemType, long flags, char* string_flags); 134 char* filesystemType, long flags, char* string_flags);
135extern void erase_mtab(const char * name); 135extern void erase_mtab(const char * name);
136extern long *find_pid_by_name( const char* pidName); 136extern long *find_pid_by_name( const char* pidName);
@@ -276,7 +276,7 @@ enum {
276 MEGABYTE = (KILOBYTE*1024), 276 MEGABYTE = (KILOBYTE*1024),
277 GIGABYTE = (MEGABYTE*1024) 277 GIGABYTE = (MEGABYTE*1024)
278}; 278};
279const char *make_human_readable_str(unsigned long long size, 279const char *make_human_readable_str(unsigned long long size,
280 unsigned long block_size, unsigned long display_unit); 280 unsigned long block_size, unsigned long display_unit);
281 281
282int bb_ask_confirmation(void); 282int bb_ask_confirmation(void);
diff --git a/include/unarchive.h b/include/unarchive.h
index bbf11b557..1679b73ab 100644
--- a/include/unarchive.h
+++ b/include/unarchive.h
@@ -37,7 +37,7 @@ typedef struct archive_handle_s {
37 37
38 /* process the data component, e.g. extract to filesystem */ 38 /* process the data component, e.g. extract to filesystem */
39 void (*action_data)(struct archive_handle_s *); 39 void (*action_data)(struct archive_handle_s *);
40 40
41 /* How to process any sub archive, e.g. get_header_tar_gz */ 41 /* How to process any sub archive, e.g. get_header_tar_gz */
42 char (*action_data_subarchive)(struct archive_handle_s *); 42 char (*action_data_subarchive)(struct archive_handle_s *);
43 43
diff --git a/init/Makefile b/init/Makefile
index 816230bf3..d23532735 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/init/Makefile.in b/init/Makefile.in
index 1b13f693b..039921435 100644
--- a/init/Makefile.in
+++ b/init/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/init/halt.c b/init/halt.c
index decdaeafd..bfc0042fa 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini halt implementation for busybox 3 * Mini halt implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/init/init.c b/init/init.c
index d332ccdbe..159b53912 100644
--- a/init/init.c
+++ b/init/init.c
@@ -3,7 +3,7 @@
3 * Mini init implementation for busybox 3 * Mini init implementation for busybox
4 * 4 *
5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. 5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
6 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * Adjusted by so many folks, it's impossible to keep track. 7 * Adjusted by so many folks, it's impossible to keep track.
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
@@ -22,7 +22,7 @@
22 * 22 *
23 */ 23 */
24 24
25/* Turn this on to disable all the dangerous 25/* Turn this on to disable all the dangerous
26 rebooting stuff when debugging. 26 rebooting stuff when debugging.
27#define DEBUG_INIT 27#define DEBUG_INIT
28*/ 28*/
@@ -97,7 +97,7 @@ struct serial_struct {
97 97
98#if defined CONFIG_FEATURE_INIT_COREDUMPS 98#if defined CONFIG_FEATURE_INIT_COREDUMPS
99/* 99/*
100 * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called 100 * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called
101 * before processes are spawned to set core file size as unlimited. 101 * before processes are spawned to set core file size as unlimited.
102 * This is for debugging only. Don't use this is production, unless 102 * This is for debugging only. Don't use this is production, unless
103 * you want core dumps lying about.... 103 * you want core dumps lying about....
@@ -351,7 +351,7 @@ static void console_init(void)
351 if ((s = getenv("CONSOLE")) != NULL || (s = getenv("console")) != NULL) { 351 if ((s = getenv("CONSOLE")) != NULL || (s = getenv("console")) != NULL) {
352 safe_strncpy(console, s, sizeof(console)); 352 safe_strncpy(console, s, sizeof(console));
353#if #cpu(sparc) 353#if #cpu(sparc)
354 /* sparc kernel supports console=tty[ab] parameter which is also 354 /* sparc kernel supports console=tty[ab] parameter which is also
355 * passed to init, so catch it here */ 355 * passed to init, so catch it here */
356 /* remap tty[ab] to /dev/ttyS[01] */ 356 /* remap tty[ab] to /dev/ttyS[01] */
357 if (strcmp(s, "ttya") == 0) 357 if (strcmp(s, "ttya") == 0)
@@ -555,8 +555,8 @@ static pid_t run(const struct init_action *a)
555 555
556 /* 556 /*
557 Interactive shells want to see a dash in argv[0]. This 557 Interactive shells want to see a dash in argv[0]. This
558 typically is handled by login, argv will be setup this 558 typically is handled by login, argv will be setup this
559 way if a dash appears at the front of the command path 559 way if a dash appears at the front of the command path
560 (like "-/bin/sh"). 560 (like "-/bin/sh").
561 */ 561 */
562 562
@@ -585,7 +585,7 @@ static pid_t run(const struct init_action *a)
585 * before the user wants it. This is critical if swap is not 585 * before the user wants it. This is critical if swap is not
586 * enabled and the system has low memory. Generally this will 586 * enabled and the system has low memory. Generally this will
587 * be run on the second virtual console, and the first will 587 * be run on the second virtual console, and the first will
588 * be allowed to start a shell or whatever an init script 588 * be allowed to start a shell or whatever an init script
589 * specifies. 589 * specifies.
590 */ 590 */
591 messageD(LOG, "Waiting for enter to start '%s'" 591 messageD(LOG, "Waiting for enter to start '%s'"
@@ -610,7 +610,7 @@ static pid_t run(const struct init_action *a)
610 } 610 }
611#endif 611#endif
612 612
613 /* Now run it. The new program will take over this PID, 613 /* Now run it. The new program will take over this PID,
614 * so nothing further in init.c should be run. */ 614 * so nothing further in init.c should be run. */
615 execv(cmdpath, cmd); 615 execv(cmdpath, cmd);
616 616
@@ -672,7 +672,7 @@ static void init_reboot(unsigned long magic)
672{ 672{
673 pid_t pid; 673 pid_t pid;
674 /* We have to fork here, since the kernel calls do_exit(0) in 674 /* We have to fork here, since the kernel calls do_exit(0) in
675 * linux/kernel/sys.c, which can cause the machine to panic when 675 * linux/kernel/sys.c, which can cause the machine to panic when
676 * the init process is killed.... */ 676 * the init process is killed.... */
677 if ((pid = fork()) == 0) { 677 if ((pid = fork()) == 0) {
678 reboot(magic); 678 reboot(magic);
@@ -866,7 +866,7 @@ static void new_init_action(int action, const char *command, const char *cons)
866 /* Append to the end of the list */ 866 /* Append to the end of the list */
867 for (a = init_action_list; a && a->next; a = a->next) { 867 for (a = init_action_list; a && a->next; a = a->next) {
868 /* don't enter action if it's already in the list */ 868 /* don't enter action if it's already in the list */
869 if ((strcmp(a->command, command) == 0) && 869 if ((strcmp(a->command, command) == 0) &&
870 (strcmp(a->terminal, cons) ==0)) { 870 (strcmp(a->terminal, cons) ==0)) {
871 free(new_action); 871 free(new_action);
872 return; 872 return;
@@ -934,9 +934,9 @@ static void check_memory(void)
934 934
935/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined, 935/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
936 * then parse_inittab() simply adds in some default 936 * then parse_inittab() simply adds in some default
937 * actions(i.e., runs INIT_SCRIPT and then starts a pair 937 * actions(i.e., runs INIT_SCRIPT and then starts a pair
938 * of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB 938 * of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB
939 * _is_ defined, but /etc/inittab is missing, this 939 * _is_ defined, but /etc/inittab is missing, this
940 * results in the same set of default behaviors. 940 * results in the same set of default behaviors.
941 */ 941 */
942static void parse_inittab(void) 942static void parse_inittab(void)
@@ -1053,7 +1053,7 @@ static void reload_signal(int sig)
1053 run_actions(RESPAWN); 1053 run_actions(RESPAWN);
1054 return; 1054 return;
1055} 1055}
1056 1056
1057extern int init_main(int argc, char **argv) 1057extern int init_main(int argc, char **argv)
1058{ 1058{
1059 struct init_action *a; 1059 struct init_action *a;
@@ -1083,7 +1083,7 @@ extern int init_main(int argc, char **argv)
1083 signal(SIGSTOP, stop_handler); 1083 signal(SIGSTOP, stop_handler);
1084 signal(SIGTSTP, stop_handler); 1084 signal(SIGTSTP, stop_handler);
1085 1085
1086 /* Turn off rebooting via CTL-ALT-DEL -- we get a 1086 /* Turn off rebooting via CTL-ALT-DEL -- we get a
1087 * SIGINT on CAD so we can shut things down gracefully... */ 1087 * SIGINT on CAD so we can shut things down gracefully... */
1088 init_reboot(RB_DISABLE_CAD); 1088 init_reboot(RB_DISABLE_CAD);
1089#endif 1089#endif
@@ -1125,7 +1125,7 @@ extern int init_main(int argc, char **argv)
1125 1125
1126 /* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined, 1126 /* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
1127 * then parse_inittab() simply adds in some default 1127 * then parse_inittab() simply adds in some default
1128 * actions(i.e., runs INIT_SCRIPT and then starts a pair 1128 * actions(i.e., runs INIT_SCRIPT and then starts a pair
1129 * of "askfirst" shells */ 1129 * of "askfirst" shells */
1130 parse_inittab(); 1130 parse_inittab();
1131 } 1131 }
diff --git a/init/init_shared.c b/init/init_shared.c
index 4b822fa94..0ad55a433 100644
--- a/init/init_shared.c
+++ b/init/init_shared.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Stuff shared between init, reboot, halt, and poweroff 3 * Stuff shared between init, reboot, halt, and poweroff
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/init/poweroff.c b/init/poweroff.c
index e5d45dfa0..81695087d 100644
--- a/init/poweroff.c
+++ b/init/poweroff.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini poweroff implementation for busybox 3 * Mini poweroff implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/init/reboot.c b/init/reboot.c
index 185152a71..ca4e9a240 100644
--- a/init/reboot.c
+++ b/init/reboot.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini reboot implementation for busybox 3 * Mini reboot implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/Makefile b/libbb/Makefile
index 774cc75ed..fbcb12330 100644
--- a/libbb/Makefile
+++ b/libbb/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/libbb/README b/libbb/README
index b92910055..4f28f7e34 100644
--- a/libbb/README
+++ b/libbb/README
@@ -1,11 +1,11 @@
1Please see the LICENSE file for copyright information (GPLv2) 1Please see the LICENSE file for copyright information (GPLv2)
2 2
3libbb is BusyBox's utility library. All of this stuff used to be stuffed into 3libbb is BusyBox's utility library. All of this stuff used to be stuffed into
4a single file named utility.c. When I split utility.c to create libbb, some of 4a single file named utility.c. When I split utility.c to create libbb, some of
5the very oldest stuff ended up without their original copyright and licensing 5the very oldest stuff ended up without their original copyright and licensing
6information (which is now lost in the mists of time). If you see something 6information (which is now lost in the mists of time). If you see something
7that you wrote that is mis-attributed, do let me know so we can fix that up. 7that you wrote that is mis-attributed, do let me know so we can fix that up.
8 8
9 Erik Andersen 9 Erik Andersen
10 <andersen@codepoet.org> 10 <andersen@codepoet.org>
11 11
diff --git a/libbb/bb_asprintf.c b/libbb/bb_asprintf.c
index 7075b46de..a3ba42454 100644
--- a/libbb/bb_asprintf.c
+++ b/libbb/bb_asprintf.c
@@ -11,7 +11,7 @@ void bb_xasprintf(char **string_ptr, const char *format, ...)
11{ 11{
12 va_list p; 12 va_list p;
13 int r; 13 int r;
14 14
15 va_start(p, format); 15 va_start(p, format);
16 r = vasprintf(string_ptr, format, p); 16 r = vasprintf(string_ptr, format, p);
17 va_end(p); 17 va_end(p);
diff --git a/libbb/chomp.c b/libbb/chomp.c
index 4fcbb263d..774e533d4 100644
--- a/libbb/chomp.c
+++ b/libbb/chomp.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
@@ -29,7 +29,7 @@
29void chomp(char *s) 29void chomp(char *s)
30{ 30{
31 char *lc = last_char_is(s, '\n'); 31 char *lc = last_char_is(s, '\n');
32 32
33 if(lc) 33 if(lc)
34 *lc = 0; 34 *lc = 0;
35} 35}
diff --git a/libbb/concat_path_file.c b/libbb/concat_path_file.c
index f0ce3d91c..77c054530 100644
--- a/libbb/concat_path_file.c
+++ b/libbb/concat_path_file.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index 00115e2c9..bf0a390a3 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/correct_password.c b/libbb/correct_password.c
index 396253614..1da83c441 100644
--- a/libbb/correct_password.c
+++ b/libbb/correct_password.c
@@ -49,14 +49,14 @@
49int correct_password ( const struct passwd *pw ) 49int correct_password ( const struct passwd *pw )
50{ 50{
51 char *unencrypted, *encrypted, *correct; 51 char *unencrypted, *encrypted, *correct;
52 52
53#ifdef CONFIG_FEATURE_SHADOWPASSWDS 53#ifdef CONFIG_FEATURE_SHADOWPASSWDS
54 if (( strcmp ( pw-> pw_passwd, "x" ) == 0 ) || ( strcmp ( pw-> pw_passwd, "*" ) == 0 )) { 54 if (( strcmp ( pw-> pw_passwd, "x" ) == 0 ) || ( strcmp ( pw-> pw_passwd, "*" ) == 0 )) {
55 struct spwd *sp = getspnam ( pw-> pw_name ); 55 struct spwd *sp = getspnam ( pw-> pw_name );
56 56
57 if ( !sp ) 57 if ( !sp )
58 bb_error_msg_and_die ( "no valid shadow password" ); 58 bb_error_msg_and_die ( "no valid shadow password" );
59 59
60 correct = sp-> sp_pwdp; 60 correct = sp-> sp_pwdp;
61 } 61 }
62 else 62 else
diff --git a/libbb/device_open.c b/libbb/device_open.c
index abfe2318a..61f954f46 100644
--- a/libbb/device_open.c
+++ b/libbb/device_open.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/dump.c b/libbb/dump.c
index 5046b926b..f169da677 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -248,8 +248,8 @@ static void rewrite(FS * fs)
248 pr->cchar = pr->fmt + (p1 - fmtp); 248 pr->cchar = pr->fmt + (p1 - fmtp);
249 249
250 /* DBU:[dave@cray.com] w/o this, trailing fmt text, space is lost. 250 /* DBU:[dave@cray.com] w/o this, trailing fmt text, space is lost.
251 * Skip subsequent text and up to the next % sign and tack the 251 * Skip subsequent text and up to the next % sign and tack the
252 * additional text onto fmt: eg. if fmt is "%x is a HEX number", 252 * additional text onto fmt: eg. if fmt is "%x is a HEX number",
253 * we lose the " is a HEX number" part of fmt. 253 * we lose the " is a HEX number" part of fmt.
254 */ 254 */
255 for (p3 = p2; *p3 && *p3 != '%'; p3++); 255 for (p3 = p2; *p3 && *p3 != '%'; p3++);
diff --git a/libbb/error_msg.c b/libbb/error_msg.c
index dbb25b7c9..18811b8d1 100644
--- a/libbb/error_msg.c
+++ b/libbb/error_msg.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/error_msg_and_die.c b/libbb/error_msg_and_die.c
index 433f29d0f..0937658a3 100644
--- a/libbb/error_msg_and_die.c
+++ b/libbb/error_msg_and_die.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/fgets_str.c b/libbb/fgets_str.c
index 72fde58d1..bf828be95 100644
--- a/libbb/fgets_str.c
+++ b/libbb/fgets_str.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libbb/find_mount_point.c b/libbb/find_mount_point.c
index b63203852..83824de9e 100644
--- a/libbb/find_mount_point.c
+++ b/libbb/find_mount_point.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/find_pid_by_name.c b/libbb/find_pid_by_name.c
index 77fa0179e..930710f32 100644
--- a/libbb/find_pid_by_name.c
+++ b/libbb/find_pid_by_name.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -25,15 +25,15 @@
25#include <stdlib.h> 25#include <stdlib.h>
26#include "libbb.h" 26#include "libbb.h"
27 27
28#define COMM_LEN 16 /* synchronize with size of comm in struct task_struct 28#define COMM_LEN 16 /* synchronize with size of comm in struct task_struct
29 in /usr/include/linux/sched.h */ 29 in /usr/include/linux/sched.h */
30 30
31 31
32/* find_pid_by_name() 32/* find_pid_by_name()
33 * 33 *
34 * Modified by Vladimir Oleynik for use with libbb/procps.c 34 * Modified by Vladimir Oleynik for use with libbb/procps.c
35 * This finds the pid of the specified process. 35 * This finds the pid of the specified process.
36 * Currently, it's implemented by rummaging through 36 * Currently, it's implemented by rummaging through
37 * the proc filesystem. 37 * the proc filesystem.
38 * 38 *
39 * Returns a list of all matching PIDs 39 * Returns a list of all matching PIDs
diff --git a/libbb/find_root_device.c b/libbb/find_root_device.c
index 836ce44d5..81824a216 100644
--- a/libbb/find_root_device.c
+++ b/libbb/find_root_device.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@ extern char *find_real_root_device_name(const char* name)
35 char *fileName = NULL; 35 char *fileName = NULL;
36 dev_t dev; 36 dev_t dev;
37 37
38 if (stat("/", &rootStat) != 0) 38 if (stat("/", &rootStat) != 0)
39 bb_perror_msg("could not stat '/'"); 39 bb_perror_msg("could not stat '/'");
40 else { 40 else {
41 /* This check is here in case they pass in /dev name */ 41 /* This check is here in case they pass in /dev name */
@@ -45,7 +45,7 @@ extern char *find_real_root_device_name(const char* name)
45 dev = rootStat.st_dev; 45 dev = rootStat.st_dev;
46 46
47 dir = opendir("/dev"); 47 dir = opendir("/dev");
48 if (!dir) 48 if (!dir)
49 bb_perror_msg("could not open '/dev'"); 49 bb_perror_msg("could not open '/dev'");
50 else { 50 else {
51 while((entry = readdir(dir)) != NULL) { 51 while((entry = readdir(dir)) != NULL) {
@@ -59,9 +59,9 @@ extern char *find_real_root_device_name(const char* name)
59 59
60 /* Some char devices have the same dev_t as block 60 /* Some char devices have the same dev_t as block
61 * devices, so make sure this is a block device */ 61 * devices, so make sure this is a block device */
62 if (stat(fileName, &statBuf) == 0 && 62 if (stat(fileName, &statBuf) == 0 &&
63 S_ISBLK(statBuf.st_mode)!=0 && 63 S_ISBLK(statBuf.st_mode)!=0 &&
64 statBuf.st_rdev == dev) 64 statBuf.st_rdev == dev)
65 break; 65 break;
66 free(fileName); 66 free(fileName);
67 fileName=NULL; 67 fileName=NULL;
diff --git a/libbb/full_read.c b/libbb/full_read.c
index f4b332dca..221fc947b 100644
--- a/libbb/full_read.c
+++ b/libbb/full_read.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/full_write.c b/libbb/full_write.c
index 30c7a5079..30de4078a 100644
--- a/libbb/full_write.c
+++ b/libbb/full_write.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/get_console.c b/libbb/get_console.c
index 0dc24cb78..bfb7468a8 100644
--- a/libbb/get_console.c
+++ b/libbb/get_console.c
@@ -29,7 +29,7 @@
29 29
30 30
31 31
32/* From <linux/kd.h> */ 32/* From <linux/kd.h> */
33static const int KDGKBTYPE = 0x4B33; /* get keyboard type */ 33static const int KDGKBTYPE = 0x4B33; /* get keyboard type */
34 34
35 35
diff --git a/libbb/get_line_from_file.c b/libbb/get_line_from_file.c
index 9a831f184..6d12b21c4 100644
--- a/libbb/get_line_from_file.c
+++ b/libbb/get_line_from_file.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libbb/get_terminal_width_height.c b/libbb/get_terminal_width_height.c
index 69f6a17e5..ef90463fb 100644
--- a/libbb/get_terminal_width_height.c
+++ b/libbb/get_terminal_width_height.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Determine the width and height of the terminal. 3 * Determine the width and height of the terminal.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -30,7 +30,7 @@
30 30
31/* It is perfectly ok to pass in a NULL for either width or for 31/* It is perfectly ok to pass in a NULL for either width or for
32 * height, in which case that value will not be set. It is also 32 * height, in which case that value will not be set. It is also
33 * perfectly ok to have CONFIG_FEATURE_AUTOWIDTH disabled, in 33 * perfectly ok to have CONFIG_FEATURE_AUTOWIDTH disabled, in
34 * which case you will always get 80x24 */ 34 * which case you will always get 80x24 */
35void get_terminal_width_height(int fd, int *width, int *height) 35void get_terminal_width_height(int fd, int *width, int *height)
36{ 36{
diff --git a/libbb/hash_fd.c b/libbb/hash_fd.c
index e79d6d6f6..e37ac549a 100644
--- a/libbb/hash_fd.c
+++ b/libbb/hash_fd.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Glenn L. McGrath 5 * Copyright (C) 2003 Glenn L. McGrath
6 * Copyright (C) 2003 Erik Andersen 6 * Copyright (C) 2003 Erik Andersen
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
@@ -47,27 +47,27 @@
47 47
48 LICENSE TERMS 48 LICENSE TERMS
49 49
50 The free distribution and use of this software in both source and binary 50 The free distribution and use of this software in both source and binary
51 form is allowed (with or without changes) provided that: 51 form is allowed (with or without changes) provided that:
52 52
53 1. distributions of this source code include the above copyright 53 1. distributions of this source code include the above copyright
54 notice, this list of conditions and the following disclaimer; 54 notice, this list of conditions and the following disclaimer;
55 55
56 2. distributions in binary form include the above copyright 56 2. distributions in binary form include the above copyright
57 notice, this list of conditions and the following disclaimer 57 notice, this list of conditions and the following disclaimer
58 in the documentation and/or other associated materials; 58 in the documentation and/or other associated materials;
59 59
60 3. the copyright holder's name is not used to endorse products 60 3. the copyright holder's name is not used to endorse products
61 built using this software without specific written permission. 61 built using this software without specific written permission.
62 62
63 ALTERNATIVELY, provided that this notice is retained in full, this product 63 ALTERNATIVELY, provided that this notice is retained in full, this product
64 may be distributed under the terms of the GNU General Public License (GPL), 64 may be distributed under the terms of the GNU General Public License (GPL),
65 in which case the provisions of the GPL apply INSTEAD OF those given above. 65 in which case the provisions of the GPL apply INSTEAD OF those given above.
66 66
67 DISCLAIMER 67 DISCLAIMER
68 68
69 This software is provided 'as is' with no explicit or implied warranties 69 This software is provided 'as is' with no explicit or implied warranties
70 in respect of its properties, including, but not limited to, correctness 70 in respect of its properties, including, but not limited to, correctness
71 and/or fitness for purpose. 71 and/or fitness for purpose.
72 --------------------------------------------------------------------------- 72 ---------------------------------------------------------------------------
73 Issue Date: 10/11/2002 73 Issue Date: 10/11/2002
@@ -805,7 +805,7 @@ extern int hash_fd(int src_fd, const size_t size, const uint8_t hash_algo,
805 cx = &md5_cx; 805 cx = &md5_cx;
806 } 806 }
807#endif 807#endif
808 808
809 /* Initialize the computation context. */ 809 /* Initialize the computation context. */
810#ifdef CONFIG_SHA1SUM 810#ifdef CONFIG_SHA1SUM
811 if (hash_algo == HASH_SHA1) { 811 if (hash_algo == HASH_SHA1) {
diff --git a/libbb/herror_msg.c b/libbb/herror_msg.c
index fb2a17b73..87ec15acc 100644
--- a/libbb/herror_msg.c
+++ b/libbb/herror_msg.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/herror_msg_and_die.c b/libbb/herror_msg_and_die.c
index b53a56de8..5c765f1be 100644
--- a/libbb/herror_msg_and_die.c
+++ b/libbb/herror_msg_and_die.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/human_readable.c b/libbb/human_readable.c
index 656889150..ad9025c08 100644
--- a/libbb/human_readable.c
+++ b/libbb/human_readable.c
@@ -13,8 +13,8 @@
13 * representations (say, powers of 1024) and manipulating coefficients. 13 * representations (say, powers of 1024) and manipulating coefficients.
14 * The base ten "bytes" output could be handled similarly. 14 * The base ten "bytes" output could be handled similarly.
15 * 15 *
16 * 2) This routine always outputs a decimal point and a tenths digit when 16 * 2) This routine always outputs a decimal point and a tenths digit when
17 * display_unit != 0. Hence, it isn't uncommon for the returned string 17 * display_unit != 0. Hence, it isn't uncommon for the returned string
18 * to have a length of 5 or 6. 18 * to have a length of 5 or 6.
19 * 19 *
20 * It might be nice to add a flag to indicate no decimal digits in 20 * It might be nice to add a flag to indicate no decimal digits in
@@ -28,7 +28,7 @@
28#include <stdio.h> 28#include <stdio.h>
29#include "libbb.h" 29#include "libbb.h"
30 30
31const char *make_human_readable_str(unsigned long long size, 31const char *make_human_readable_str(unsigned long long size,
32 unsigned long block_size, unsigned long display_unit) 32 unsigned long block_size, unsigned long display_unit)
33{ 33{
34 /* The code will adjust for additional (appended) units. */ 34 /* The code will adjust for additional (appended) units. */
@@ -37,7 +37,7 @@ const char *make_human_readable_str(unsigned long long size,
37 static const char fmt_tenths[] = "%Lu.%d%c"; 37 static const char fmt_tenths[] = "%Lu.%d%c";
38 38
39 static char str[21]; /* Sufficient for 64 bit unsigned integers. */ 39 static char str[21]; /* Sufficient for 64 bit unsigned integers. */
40 40
41 unsigned long long val; 41 unsigned long long val;
42 int frac; 42 int frac;
43 const char *u; 43 const char *u;
diff --git a/libbb/inode_hash.c b/libbb/inode_hash.c
index ea82e8ce6..fbcd81327 100644
--- a/libbb/inode_hash.c
+++ b/libbb/inode_hash.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
@@ -69,7 +69,7 @@ void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name)
69 int i; 69 int i;
70 size_t s; 70 size_t s;
71 ino_dev_hashtable_bucket_t *bucket; 71 ino_dev_hashtable_bucket_t *bucket;
72 72
73 i = hash_inode(statbuf->st_ino); 73 i = hash_inode(statbuf->st_ino);
74 s = name ? strlen(name) : 0; 74 s = name ? strlen(name) : 0;
75 bucket = xmalloc(sizeof(ino_dev_hashtable_bucket_t) + s); 75 bucket = xmalloc(sizeof(ino_dev_hashtable_bucket_t) + s);
diff --git a/libbb/interface.c b/libbb/interface.c
index 28007f443..f44e866df 100644
--- a/libbb/interface.c
+++ b/libbb/interface.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * stolen from net-tools-1.59 and stripped down for busybox by 2 * stolen from net-tools-1.59 and stripped down for busybox by
3 * Erik Andersen <andersen@codepoet.org> 3 * Erik Andersen <andersen@codepoet.org>
4 * 4 *
5 * Heavily modified by Manuel Novoa III Mar 12, 2001 5 * Heavily modified by Manuel Novoa III Mar 12, 2001
@@ -15,7 +15,7 @@
15 * that either displays or sets the characteristics of 15 * that either displays or sets the characteristics of
16 * one or more of the system's networking interfaces. 16 * one or more of the system's networking interfaces.
17 * 17 *
18 * Version: $Id: interface.c,v 1.20 2003/08/29 11:34:08 bug1 Exp $ 18 * Version: $Id: interface.c,v 1.21 2004/03/15 08:28:42 andersen Exp $
19 * 19 *
20 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 20 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
21 * and others. Copyright 1993 MicroWalt Corporation 21 * and others. Copyright 1993 MicroWalt Corporation
@@ -31,17 +31,17 @@
31 * 31 *
32 * {1.34} - 19980630 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> 32 * {1.34} - 19980630 - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
33 * - gettext instead of catgets for i18n 33 * - gettext instead of catgets for i18n
34 * 10/1998 - Andi Kleen. Use interface list primitives. 34 * 10/1998 - Andi Kleen. Use interface list primitives.
35 * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu 35 * 20001008 - Bernd Eckenfels, Patch from RH for setting mtu
36 * (default AF was wrong) 36 * (default AF was wrong)
37 */ 37 */
38 38
39/* #define KEEP_UNUSED */ 39/* #define KEEP_UNUSED */
40 40
41/* 41/*
42 * 42 *
43 * Protocol Families. 43 * Protocol Families.
44 * 44 *
45 */ 45 */
46#define HAVE_AFINET 1 46#define HAVE_AFINET 1
47#undef HAVE_AFIPX 47#undef HAVE_AFIPX
@@ -51,10 +51,10 @@
51#undef HAVE_AFECONET 51#undef HAVE_AFECONET
52#undef HAVE_AFASH 52#undef HAVE_AFASH
53 53
54/* 54/*
55 * 55 *
56 * Device Hardware types. 56 * Device Hardware types.
57 * 57 *
58 */ 58 */
59#define HAVE_HWETHER 1 59#define HAVE_HWETHER 1
60#define HAVE_HWPPP 1 60#define HAVE_HWPPP 1
@@ -1822,7 +1822,7 @@ static void ife_print(struct interface *ptr)
1822 hw = get_hwntype(-1); 1822 hw = get_hwntype(-1);
1823 1823
1824 printf(_("%-9.9s Link encap:%s "), ptr->name, _(hw->title)); 1824 printf(_("%-9.9s Link encap:%s "), ptr->name, _(hw->title));
1825 /* For some hardware types (eg Ash, ATM) we don't print the 1825 /* For some hardware types (eg Ash, ATM) we don't print the
1826 hardware address if it's null. */ 1826 hardware address if it's null. */
1827 if (hw->print != NULL && (!(hw_null_address(hw, ptr->hwaddr) && 1827 if (hw->print != NULL && (!(hw_null_address(hw, ptr->hwaddr) &&
1828 hw->suppress_null_addr))) 1828 hw->suppress_null_addr)))
@@ -2011,7 +2011,7 @@ static void ife_print(struct interface *ptr)
2011 printf(" "); 2011 printf(" ");
2012 if (ptr->map.irq) 2012 if (ptr->map.irq)
2013 printf(_("Interrupt:%d "), ptr->map.irq); 2013 printf(_("Interrupt:%d "), ptr->map.irq);
2014 if (ptr->map.base_addr >= 0x100) /* Only print devices using it for 2014 if (ptr->map.base_addr >= 0x100) /* Only print devices using it for
2015 I/O maps */ 2015 I/O maps */
2016 printf(_("Base address:0x%lx "), 2016 printf(_("Base address:0x%lx "),
2017 (unsigned long) ptr->map.base_addr); 2017 (unsigned long) ptr->map.base_addr);
diff --git a/libbb/isdirectory.c b/libbb/isdirectory.c
index e9b106aa3..f3caaf178 100644
--- a/libbb/isdirectory.c
+++ b/libbb/isdirectory.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell 5 * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
6 * Permission has been granted to redistribute this code under the GPL. 6 * Permission has been granted to redistribute this code under the GPL.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c
index 740ac523c..e01aafa25 100644
--- a/libbb/kernel_version.c
+++ b/libbb/kernel_version.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/loop.c b/libbb/loop.c
index 4d73dc4cc..81d1f0ab6 100644
--- a/libbb/loop.c
+++ b/libbb/loop.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/messages.c b/libbb/messages.c
index adfd1ffcc..671c452d2 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/module_syscalls.c b/libbb/module_syscalls.c
index 81fb8f255..a2ff5284a 100644
--- a/libbb/module_syscalls.c
+++ b/libbb/module_syscalls.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * some system calls possibly missing from libc 3 * some system calls possibly missing from libc
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/mtab.c b/libbb/mtab.c
index a62169a26..528422567 100644
--- a/libbb/mtab.c
+++ b/libbb/mtab.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/mtab_file.c b/libbb/mtab_file.c
index 58b0f66e2..42504e81f 100644
--- a/libbb/mtab_file.c
+++ b/libbb/mtab_file.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -23,8 +23,8 @@
23#include "libbb.h" 23#include "libbb.h"
24 24
25 25
26/* Busybox mount uses either /proc/mounts or /etc/mtab to 26/* Busybox mount uses either /proc/mounts or /etc/mtab to
27 * get the list of currently mounted filesystems */ 27 * get the list of currently mounted filesystems */
28#if defined CONFIG_FEATURE_MTAB_SUPPORT 28#if defined CONFIG_FEATURE_MTAB_SUPPORT
29const char bb_path_mtab_file[] = CONFIG_FEATURE_MTAB_FILENAME; 29const char bb_path_mtab_file[] = CONFIG_FEATURE_MTAB_FILENAME;
30#else 30#else
diff --git a/libbb/my_getgrgid.c b/libbb/my_getgrgid.c
index 5a36c890d..907a47486 100644
--- a/libbb/my_getgrgid.c
+++ b/libbb/my_getgrgid.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/my_getgrnam.c b/libbb/my_getgrnam.c
index 906727b76..22a617cc8 100644
--- a/libbb/my_getgrnam.c
+++ b/libbb/my_getgrnam.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/my_getpwnam.c b/libbb/my_getpwnam.c
index 57c2a01ec..a9fd0cd09 100644
--- a/libbb/my_getpwnam.c
+++ b/libbb/my_getpwnam.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/my_getpwnamegid.c b/libbb/my_getpwnamegid.c
index 1dd5674ec..d1457900e 100644
--- a/libbb/my_getpwnamegid.c
+++ b/libbb/my_getpwnamegid.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/my_getpwuid.c b/libbb/my_getpwuid.c
index ec2fcce74..21a037f75 100644
--- a/libbb/my_getpwuid.c
+++ b/libbb/my_getpwuid.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c
index 7132c76ef..185957bc3 100644
--- a/libbb/parse_mode.c
+++ b/libbb/parse_mode.c
@@ -31,7 +31,7 @@
31 31
32extern int bb_parse_mode(const char *s, mode_t *current_mode) 32extern int bb_parse_mode(const char *s, mode_t *current_mode)
33{ 33{
34 static const mode_t who_mask[] = { 34 static const mode_t who_mask[] = {
35 S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO, /* a */ 35 S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO, /* a */
36 S_ISUID | S_IRWXU, /* u */ 36 S_ISUID | S_IRWXU, /* u */
37 S_ISGID | S_IRWXG, /* g */ 37 S_ISGID | S_IRWXG, /* g */
diff --git a/libbb/parse_number.c b/libbb/parse_number.c
index 92ad6a216..5262239ff 100644
--- a/libbb/parse_number.c
+++ b/libbb/parse_number.c
@@ -34,7 +34,7 @@ unsigned long bb_xparse_number(const char *numstr,
34 unsigned long int r; 34 unsigned long int r;
35 char *e; 35 char *e;
36 int old_errno; 36 int old_errno;
37 37
38 /* Since this is a lib function, we're not allowed to reset errno to 0. 38 /* Since this is a lib function, we're not allowed to reset errno to 0.
39 * Doing so could break an app that is deferring checking of errno. 39 * Doing so could break an app that is deferring checking of errno.
40 * So, save the old value so that we can restore it if successful. */ 40 * So, save the old value so that we can restore it if successful. */
diff --git a/libbb/perror_msg.c b/libbb/perror_msg.c
index 0928e4371..8ba053188 100644
--- a/libbb/perror_msg.c
+++ b/libbb/perror_msg.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/perror_msg_and_die.c b/libbb/perror_msg_and_die.c
index 122f3972b..15bf0421e 100644
--- a/libbb/perror_msg_and_die.c
+++ b/libbb/perror_msg_and_die.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/print_file.c b/libbb/print_file.c
index 161b398fa..bd7108d2f 100644
--- a/libbb/print_file.c
+++ b/libbb/print_file.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/printf.c b/libbb/printf.c
index 3e69331c5..3c438b2c9 100644
--- a/libbb/printf.c
+++ b/libbb/printf.c
@@ -46,7 +46,7 @@
46#include <stdarg.h> 46#include <stdarg.h>
47#include "libbb.h" 47#include "libbb.h"
48 48
49#if defined(__UCLIBC__) 49#if defined(__UCLIBC__)
50 50
51# if defined(__FLAG_ERROR) 51# if defined(__FLAG_ERROR)
52/* Using my newer stdio implementation. Unlocked macros are: 52/* Using my newer stdio implementation. Unlocked macros are:
diff --git a/libbb/process_escape_sequence.c b/libbb/process_escape_sequence.c
index ef2717bdd..f5ac500fa 100644
--- a/libbb/process_escape_sequence.c
+++ b/libbb/process_escape_sequence.c
@@ -19,7 +19,7 @@
19 * along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * 21 *
22 * 22 *
23 */ 23 */
24 24
25#include <stdio.h> 25#include <stdio.h>
@@ -37,7 +37,7 @@ char bb_process_escape_sequence(const char **ptr)
37 unsigned int num_digits; 37 unsigned int num_digits;
38 unsigned int r; 38 unsigned int r;
39 unsigned int n; 39 unsigned int n;
40 40
41 n = 0; 41 n = 0;
42 q = *ptr; 42 q = *ptr;
43 43
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
index ce6078539..727149d0c 100644
--- a/libbb/pw_encrypt.c
+++ b/libbb/pw_encrypt.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routine. 3 * Utility routine.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/read_package_field.c b/libbb/read_package_field.c
index abe8e06fd..4292689ca 100644
--- a/libbb/read_package_field.c
+++ b/libbb/read_package_field.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libbb/recursive_action.c b/libbb/recursive_action.c
index 6ee59e8f1..d27629829 100644
--- a/libbb/recursive_action.c
+++ b/libbb/recursive_action.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -30,12 +30,12 @@
30 30
31 31
32/* 32/*
33 * Walk down all the directories under the specified 33 * Walk down all the directories under the specified
34 * location, and do something (something specified 34 * location, and do something (something specified
35 * by the fileAction and dirAction function pointers). 35 * by the fileAction and dirAction function pointers).
36 * 36 *
37 * Unfortunately, while nftw(3) could replace this and reduce 37 * Unfortunately, while nftw(3) could replace this and reduce
38 * code size a bit, nftw() wasn't supported before GNU libc 2.1, 38 * code size a bit, nftw() wasn't supported before GNU libc 2.1,
39 * and so isn't sufficiently portable to take over since glibc2.1 39 * and so isn't sufficiently portable to take over since glibc2.1
40 * is so stinking huge. 40 * is so stinking huge.
41 */ 41 */
diff --git a/libbb/run_parts.c b/libbb/run_parts.c
index 0eb766086..607b84190 100644
--- a/libbb/run_parts.c
+++ b/libbb/run_parts.c
@@ -111,7 +111,7 @@ extern int run_parts(char **args, const unsigned char test_mode, char **env)
111 exitstatus = 1; 111 exitstatus = 1;
112 } 112 }
113 } 113 }
114 } 114 }
115 else if (!S_ISDIR(st.st_mode)) { 115 else if (!S_ISDIR(st.st_mode)) {
116 bb_error_msg("component %s is not an executable plain file", filename); 116 bb_error_msg("component %s is not an executable plain file", filename);
117 exitstatus = 1; 117 exitstatus = 1;
@@ -121,6 +121,6 @@ extern int run_parts(char **args, const unsigned char test_mode, char **env)
121 free(filename); 121 free(filename);
122 } 122 }
123 free(namelist); 123 free(namelist);
124 124
125 return(exitstatus); 125 return(exitstatus);
126} 126}
diff --git a/libbb/run_shell.c b/libbb/run_shell.c
index 4855d763e..993b4e711 100644
--- a/libbb/run_shell.c
+++ b/libbb/run_shell.c
@@ -54,20 +54,20 @@ void run_shell ( const char *shell, int loginshell, const char *command, const c
54 const char **args; 54 const char **args;
55 int argno = 1; 55 int argno = 1;
56 int additional_args_cnt = 0; 56 int additional_args_cnt = 0;
57 57
58 for ( args = additional_args; args && *args; args++ ) 58 for ( args = additional_args; args && *args; args++ )
59 additional_args_cnt++; 59 additional_args_cnt++;
60 60
61 args = (const char **) xmalloc (sizeof (char *) * ( 4 + additional_args_cnt )); 61 args = (const char **) xmalloc (sizeof (char *) * ( 4 + additional_args_cnt ));
62 62
63 args [0] = bb_get_last_path_component ( bb_xstrdup ( shell )); 63 args [0] = bb_get_last_path_component ( bb_xstrdup ( shell ));
64 64
65 if ( loginshell ) { 65 if ( loginshell ) {
66 char *args0; 66 char *args0;
67 bb_xasprintf ( &args0, "-%s", args [0] ); 67 bb_xasprintf ( &args0, "-%s", args [0] );
68 args [0] = args0; 68 args [0] = args0;
69 } 69 }
70 70
71 if ( command ) { 71 if ( command ) {
72 args [argno++] = "-c"; 72 args [argno++] = "-c";
73 args [argno++] = command; 73 args [argno++] = command;
diff --git a/libbb/safe_read.c b/libbb/safe_read.c
index 67f3268c5..92e1d8a4b 100644
--- a/libbb/safe_read.c
+++ b/libbb/safe_read.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/safe_strncpy.c b/libbb/safe_strncpy.c
index 08a2a0d9c..2016e6b52 100644
--- a/libbb/safe_strncpy.c
+++ b/libbb/safe_strncpy.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -24,11 +24,11 @@
24 24
25 25
26 26
27/* Like strncpy but make sure the resulting string is always 0 terminated. */ 27/* Like strncpy but make sure the resulting string is always 0 terminated. */
28extern char * safe_strncpy(char *dst, const char *src, size_t size) 28extern char * safe_strncpy(char *dst, const char *src, size_t size)
29{ 29{
30 dst[size-1] = '\0'; 30 dst[size-1] = '\0';
31 return strncpy(dst, src, size-1); 31 return strncpy(dst, src, size-1);
32} 32}
33 33
34 34
diff --git a/libbb/safe_write.c b/libbb/safe_write.c
index 0ac6c2d96..201ea1cd3 100644
--- a/libbb/safe_write.c
+++ b/libbb/safe_write.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c
index b18f8967e..aeb285a53 100644
--- a/libbb/setup_environment.c
+++ b/libbb/setup_environment.c
@@ -52,13 +52,13 @@ void setup_environment ( const char *shell, int loginshell, int changeenv, const
52{ 52{
53 if ( loginshell ) { 53 if ( loginshell ) {
54 const char *term; 54 const char *term;
55 55
56 /* Change the current working directory to be the home directory 56 /* Change the current working directory to be the home directory
57 * of the user. It is a fatal error for this process to be unable 57 * of the user. It is a fatal error for this process to be unable
58 * to change to that directory. There is no "default" home 58 * to change to that directory. There is no "default" home
59 * directory. 59 * directory.
60 * Some systems default to HOME=/ 60 * Some systems default to HOME=/
61 */ 61 */
62 if ( chdir ( pw-> pw_dir )) { 62 if ( chdir ( pw-> pw_dir )) {
63 if ( chdir ( "/" )) { 63 if ( chdir ( "/" )) {
64 syslog ( LOG_WARNING, "unable to cd to %s' for user %s'\n", pw-> pw_dir, pw-> pw_name ); 64 syslog ( LOG_WARNING, "unable to cd to %s' for user %s'\n", pw-> pw_dir, pw-> pw_name );
diff --git a/libbb/syscalls.c b/libbb/syscalls.c
index 8ceb35695..9e89dbd39 100644
--- a/libbb/syscalls.c
+++ b/libbb/syscalls.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * some system calls possibly missing from libc 3 * some system calls possibly missing from libc
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/syslog_msg_with_name.c b/libbb/syslog_msg_with_name.c
index 4b530416a..ac472dbda 100644
--- a/libbb/syslog_msg_with_name.c
+++ b/libbb/syslog_msg_with_name.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/trim.c b/libbb/trim.c
index 75e7c2d43..38aa28231 100644
--- a/libbb/trim.c
+++ b/libbb/trim.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c
index 681358414..be444a97b 100644
--- a/libbb/u_signal_names.c
+++ b/libbb/u_signal_names.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libbb/vdprintf.c b/libbb/vdprintf.c
index 2a19dd182..53fdbd37a 100644
--- a/libbb/vdprintf.c
+++ b/libbb/vdprintf.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index 9270290cd..07b37e4ad 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 2fd70ba1a..0601121ad 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -40,9 +40,9 @@ void vfork_daemon_rexec(int nochdir, int noclose,
40 int fd; 40 int fd;
41 char **vfork_args; 41 char **vfork_args;
42 int a = 0; 42 int a = 0;
43 43
44 setsid(); 44 setsid();
45 45
46 if (!nochdir) 46 if (!nochdir)
47 chdir("/"); 47 chdir("/");
48 48
@@ -73,6 +73,6 @@ void vfork_daemon_rexec(int nochdir, int noclose,
73 bb_perror_msg_and_die("vfork"); 73 bb_perror_msg_and_die("vfork");
74 default: /* parent */ 74 default: /* parent */
75 exit(0); 75 exit(0);
76 } 76 }
77} 77}
78#endif /* uClinux */ 78#endif /* uClinux */
diff --git a/libbb/vherror_msg.c b/libbb/vherror_msg.c
index ffdfd5283..1560eb595 100644
--- a/libbb/vherror_msg.c
+++ b/libbb/vherror_msg.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/vperror_msg.c b/libbb/vperror_msg.c
index cd48af259..5c446967a 100644
--- a/libbb/vperror_msg.c
+++ b/libbb/vperror_msg.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/wfopen.c b/libbb/wfopen.c
index 368451c52..ab77cb19e 100644
--- a/libbb/wfopen.c
+++ b/libbb/wfopen.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/libbb/xconnect.c b/libbb/xconnect.c
index 2443bb299..4cd22c74f 100644
--- a/libbb/xconnect.c
+++ b/libbb/xconnect.c
@@ -64,7 +64,7 @@ int xconnect(struct sockaddr_in *s_addr)
64 int s = socket(AF_INET, SOCK_STREAM, 0); 64 int s = socket(AF_INET, SOCK_STREAM, 0);
65 if (connect(s, (struct sockaddr_in *)s_addr, sizeof(struct sockaddr_in)) < 0) 65 if (connect(s, (struct sockaddr_in *)s_addr, sizeof(struct sockaddr_in)) < 0)
66 { 66 {
67 bb_perror_msg_and_die("Unable to connect to remote host (%s)", 67 bb_perror_msg_and_die("Unable to connect to remote host (%s)",
68 inet_ntoa(s_addr->sin_addr)); 68 inet_ntoa(s_addr->sin_addr));
69 } 69 }
70 return s; 70 return s;
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index da3775a59..01b2f87bc 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -85,7 +85,7 @@ extern char * bb_xstrndup (const char *s, int n) {
85 bb_error_msg_and_die("bb_xstrndup bug"); 85 bb_error_msg_and_die("bb_xstrndup bug");
86 86
87 t = xmalloc(++n); 87 t = xmalloc(++n);
88 88
89 return safe_strncpy(t,s,n); 89 return safe_strncpy(t,s,n);
90} 90}
91#endif 91#endif
@@ -104,7 +104,7 @@ FILE *bb_xfopen(const char *path, const char *mode)
104extern int bb_xopen(const char *pathname, int flags) 104extern int bb_xopen(const char *pathname, int flags)
105{ 105{
106 int ret; 106 int ret;
107 107
108 ret = open(pathname, flags, 0777); 108 ret = open(pathname, flags, 0777);
109 if (ret == -1) { 109 if (ret == -1) {
110 bb_perror_msg_and_die("%s", pathname); 110 bb_perror_msg_and_die("%s", pathname);
@@ -146,10 +146,10 @@ extern void bb_xread_all(int fd, void *buf, size_t count)
146extern unsigned char bb_xread_char(int fd) 146extern unsigned char bb_xread_char(int fd)
147{ 147{
148 char tmp; 148 char tmp;
149 149
150 bb_xread_all(fd, &tmp, 1); 150 bb_xread_all(fd, &tmp, 1);
151 151
152 return(tmp); 152 return(tmp);
153} 153}
154#endif 154#endif
155 155
diff --git a/libbb/xgetlarg.c b/libbb/xgetlarg.c
index ed5d3eb4f..56fb60e82 100644
--- a/libbb/xgetlarg.c
+++ b/libbb/xgetlarg.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Copyright (C) 2003 Erik Andersen <andersen@codepoet.org> 3 * Copyright (C) 2003-2004 Erik Andersen <andersen@codepoet.org>
4 */ 4 */
5 5
6 6
diff --git a/libbb/xgetularg.c b/libbb/xgetularg.c
index d743520c3..e90085446 100644
--- a/libbb/xgetularg.c
+++ b/libbb/xgetularg.c
@@ -29,7 +29,7 @@
29#include "libbb.h" 29#include "libbb.h"
30 30
31#ifdef L_xgetularg_bnd_sfx 31#ifdef L_xgetularg_bnd_sfx
32extern 32extern
33unsigned long bb_xgetularg_bnd_sfx(const char *arg, int base, 33unsigned long bb_xgetularg_bnd_sfx(const char *arg, int base,
34 unsigned long lower, 34 unsigned long lower,
35 unsigned long upper, 35 unsigned long upper,
@@ -61,7 +61,7 @@ unsigned long bb_xgetularg_bnd_sfx(const char *arg, int base,
61 bb_show_usage(); 61 bb_show_usage();
62 } 62 }
63 errno = old_errno; /* Ok. So restore errno. */ 63 errno = old_errno; /* Ok. So restore errno. */
64 64
65 /* Do optional suffix parsing. Allow 'empty' suffix tables. 65 /* Do optional suffix parsing. Allow 'empty' suffix tables.
66 * Note that we also all nul suffixes with associated multipliers, 66 * Note that we also all nul suffixes with associated multipliers,
67 * to allow for scaling of the arg by some default multiplier. */ 67 * to allow for scaling of the arg by some default multiplier. */
@@ -78,7 +78,7 @@ unsigned long bb_xgetularg_bnd_sfx(const char *arg, int base,
78 } 78 }
79 ++suffixes; 79 ++suffixes;
80 } 80 }
81 } 81 }
82 82
83 /* Finally, check for illegal trailing chars and range limits. */ 83 /* Finally, check for illegal trailing chars and range limits. */
84 /* Note: although we allow leading space (via stroul), trailing space 84 /* Note: although we allow leading space (via stroul), trailing space
@@ -92,7 +92,7 @@ unsigned long bb_xgetularg_bnd_sfx(const char *arg, int base,
92#endif 92#endif
93 93
94#ifdef L_xgetlarg_bnd_sfx 94#ifdef L_xgetlarg_bnd_sfx
95extern 95extern
96long bb_xgetlarg_bnd_sfx(const char *arg, int base, 96long bb_xgetlarg_bnd_sfx(const char *arg, int base,
97 long lower, 97 long lower,
98 long upper, 98 long upper,
@@ -124,7 +124,7 @@ long bb_xgetlarg_bnd_sfx(const char *arg, int base,
124#endif 124#endif
125 125
126#ifdef L_getlarg10_sfx 126#ifdef L_getlarg10_sfx
127extern 127extern
128long bb_xgetlarg10_sfx(const char *arg, const struct suffix_mult *suffixes) 128long bb_xgetlarg10_sfx(const char *arg, const struct suffix_mult *suffixes)
129{ 129{
130 return bb_xgetlarg_bnd_sfx(arg, 10, LONG_MIN, LONG_MAX, suffixes); 130 return bb_xgetlarg_bnd_sfx(arg, 10, LONG_MIN, LONG_MAX, suffixes);
@@ -132,7 +132,7 @@ long bb_xgetlarg10_sfx(const char *arg, const struct suffix_mult *suffixes)
132#endif 132#endif
133 133
134#ifdef L_xgetularg_bnd 134#ifdef L_xgetularg_bnd
135extern 135extern
136unsigned long bb_xgetularg_bnd(const char *arg, int base, 136unsigned long bb_xgetularg_bnd(const char *arg, int base,
137 unsigned long lower, 137 unsigned long lower,
138 unsigned long upper) 138 unsigned long upper)
@@ -142,7 +142,7 @@ unsigned long bb_xgetularg_bnd(const char *arg, int base,
142#endif 142#endif
143 143
144#ifdef L_xgetularg10_bnd 144#ifdef L_xgetularg10_bnd
145extern 145extern
146unsigned long bb_xgetularg10_bnd(const char *arg, 146unsigned long bb_xgetularg10_bnd(const char *arg,
147 unsigned long lower, 147 unsigned long lower,
148 unsigned long upper) 148 unsigned long upper)
@@ -152,7 +152,7 @@ unsigned long bb_xgetularg10_bnd(const char *arg,
152#endif 152#endif
153 153
154#ifdef L_xgetularg10 154#ifdef L_xgetularg10
155extern 155extern
156unsigned long bb_xgetularg10(const char *arg) 156unsigned long bb_xgetularg10(const char *arg)
157{ 157{
158 return bb_xgetularg10_bnd(arg, 0, ULONG_MAX); 158 return bb_xgetularg10_bnd(arg, 0, ULONG_MAX);
diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c
index b8cfe617a..21a657dfc 100644
--- a/libbb/xreadlink.c
+++ b/libbb/xreadlink.c
@@ -14,10 +14,10 @@
14#include "libbb.h" 14#include "libbb.h"
15 15
16extern char *xreadlink(const char *path) 16extern char *xreadlink(const char *path)
17{ 17{
18 static const int GROWBY = 80; /* how large we will grow strings by */ 18 static const int GROWBY = 80; /* how large we will grow strings by */
19 19
20 char *buf = NULL; 20 char *buf = NULL;
21 int bufsize = 0, readsize = 0; 21 int bufsize = 0, readsize = 0;
22 22
23 do { 23 do {
@@ -27,10 +27,10 @@ extern char *xreadlink(const char *path)
27 bb_perror_msg("%s", path); 27 bb_perror_msg("%s", path);
28 return NULL; 28 return NULL;
29 } 29 }
30 } 30 }
31 while (bufsize < readsize + 1); 31 while (bufsize < readsize + 1);
32 32
33 buf[readsize] = '\0'; 33 buf[readsize] = '\0';
34 34
35 return buf; 35 return buf;
36} 36}
diff --git a/libbb/xregcomp.c b/libbb/xregcomp.c
index bfccfec69..fa6c0fa2b 100644
--- a/libbb/xregcomp.c
+++ b/libbb/xregcomp.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Utility routines. 3 * Utility routines.
4 * 4 *
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
diff --git a/libpwdgrp/Makefile b/libpwdgrp/Makefile
index 5c54be325..79dbb462f 100644
--- a/libpwdgrp/Makefile
+++ b/libpwdgrp/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/libpwdgrp/Makefile.in b/libpwdgrp/Makefile.in
index 886639e1f..cb7cbde76 100644
--- a/libpwdgrp/Makefile.in
+++ b/libpwdgrp/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/libpwdgrp/__getgrent.c b/libpwdgrp/__getgrent.c
index a20b3a260..ed4f59c5b 100644
--- a/libpwdgrp/__getgrent.c
+++ b/libpwdgrp/__getgrent.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * __getgrent.c - This file is part of the libc-8086/grp package for ELKS, 2 * __getgrent.c - This file is part of the libc-8086/grp package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -187,7 +187,7 @@ struct group *bb_getgrent(int grp_fd)
187 } 187 }
188#else /* !GR_SCALE_DYNAMIC */ 188#else /* !GR_SCALE_DYNAMIC */
189 free(members); 189 free(members);
190 members = (char **) malloc((member_num + 1) * sizeof(char *)); 190 members = (char **) malloc((member_num + 1) * sizeof(char *));
191 for ( ; field_begin && *field_begin != '\0'; field_begin = ptr) { 191 for ( ; field_begin && *field_begin != '\0'; field_begin = ptr) {
192 if ((ptr = strchr(field_begin, ',')) != NULL) 192 if ((ptr = strchr(field_begin, ',')) != NULL)
193 *ptr++ = '\0'; 193 *ptr++ = '\0';
diff --git a/libpwdgrp/__getpwent.c b/libpwdgrp/__getpwent.c
index 1b38c27ef..09ed63139 100644
--- a/libpwdgrp/__getpwent.c
+++ b/libpwdgrp/__getpwent.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * __getpwent.c - This file is part of the libc-8086/pwd package for ELKS, 2 * __getpwent.c - This file is part of the libc-8086/pwd package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
diff --git a/libpwdgrp/fgetgrent.c b/libpwdgrp/fgetgrent.c
index da4ca053f..77c2884ed 100644
--- a/libpwdgrp/fgetgrent.c
+++ b/libpwdgrp/fgetgrent.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fgetgrent.c - This file is part of the libc-8086/grp package for ELKS, 2 * fgetgrent.c - This file is part of the libc-8086/grp package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
18 * 18 *
19 */ 19 */
20 20
21#include "busybox.h" 21#include "busybox.h"
22 22
23#include <stdio.h> 23#include <stdio.h>
24#include <errno.h> 24#include <errno.h>
diff --git a/libpwdgrp/fgetpwent.c b/libpwdgrp/fgetpwent.c
index 54c3b3adc..74bf922d7 100644
--- a/libpwdgrp/fgetpwent.c
+++ b/libpwdgrp/fgetpwent.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * fgetpwent.c - This file is part of the libc-8086/pwd package for ELKS, 2 * fgetpwent.c - This file is part of the libc-8086/pwd package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
18 * 18 *
19 */ 19 */
20 20
21#include "busybox.h" 21#include "busybox.h"
22 22
23#include <errno.h> 23#include <errno.h>
24#include <stdio.h> 24#include <stdio.h>
diff --git a/libpwdgrp/getgrgid.c b/libpwdgrp/getgrgid.c
index 0f5ce1cac..4502e2b42 100644
--- a/libpwdgrp/getgrgid.c
+++ b/libpwdgrp/getgrgid.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * getgrgid.c - This file is part of the libc-8086/grp package for ELKS, 2 * getgrgid.c - This file is part of the libc-8086/grp package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
18 * 18 *
19 */ 19 */
20 20
21#include "busybox.h" 21#include "busybox.h"
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24#include <unistd.h> 24#include <unistd.h>
diff --git a/libpwdgrp/getgrnam.c b/libpwdgrp/getgrnam.c
index 46950e2b6..766b7bc5d 100644
--- a/libpwdgrp/getgrnam.c
+++ b/libpwdgrp/getgrnam.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * getgrnam.c - This file is part of the libc-8086/grp package for ELKS, 2 * getgrnam.c - This file is part of the libc-8086/grp package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
diff --git a/libpwdgrp/getpw.c b/libpwdgrp/getpw.c
index d46e2c7da..8494a6ae9 100644
--- a/libpwdgrp/getpw.c
+++ b/libpwdgrp/getpw.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * getpw.c - This file is part of the libc-8086/pwd package for ELKS, 2 * getpw.c - This file is part of the libc-8086/pwd package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
18 * 18 *
19 */ 19 */
20 20
21#include "busybox.h" 21#include "busybox.h"
22 22
23#include <sys/types.h> 23#include <sys/types.h>
24#include <errno.h> 24#include <errno.h>
diff --git a/libpwdgrp/getpwnam.c b/libpwdgrp/getpwnam.c
index 013f155bc..f4caeeab1 100644
--- a/libpwdgrp/getpwnam.c
+++ b/libpwdgrp/getpwnam.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * getpwnam.c - This file is part of the libc-8086/pwd package for ELKS, 2 * getpwnam.c - This file is part of the libc-8086/pwd package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
18 * 18 *
19 */ 19 */
20 20
21#include "busybox.h" 21#include "busybox.h"
22 22
23#include <unistd.h> 23#include <unistd.h>
24#include <string.h> 24#include <string.h>
diff --git a/libpwdgrp/getpwuid.c b/libpwdgrp/getpwuid.c
index bae6e15e6..7fa7ed956 100644
--- a/libpwdgrp/getpwuid.c
+++ b/libpwdgrp/getpwuid.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * getpwuid.c - This file is part of the libc-8086/pwd package for ELKS, 2 * getpwuid.c - This file is part of the libc-8086/pwd package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
diff --git a/libpwdgrp/grent.c b/libpwdgrp/grent.c
index ff3c49e68..753026c29 100644
--- a/libpwdgrp/grent.c
+++ b/libpwdgrp/grent.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * grent.c - This file is part of the libc-8086/grp package for ELKS, 2 * grent.c - This file is part of the libc-8086/grp package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -24,7 +24,7 @@
24 * in together. 24 * in together.
25 */ 25 */
26 26
27#include "busybox.h" 27#include "busybox.h"
28 28
29#include <unistd.h> 29#include <unistd.h>
30#include <fcntl.h> 30#include <fcntl.h>
diff --git a/libpwdgrp/initgroups.c b/libpwdgrp/initgroups.c
index f97948379..9243fd3ac 100644
--- a/libpwdgrp/initgroups.c
+++ b/libpwdgrp/initgroups.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * initgroups.c - This file is part of the libc-8086/grp package for ELKS, 2 * initgroups.c - This file is part of the libc-8086/grp package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
18 * 18 *
19 */ 19 */
20 20
21#include "busybox.h" 21#include "busybox.h"
22 22
23#include <unistd.h> 23#include <unistd.h>
24#include <string.h> 24#include <string.h>
diff --git a/libpwdgrp/putpwent.c b/libpwdgrp/putpwent.c
index f6b3a2577..0710ff5b2 100644
--- a/libpwdgrp/putpwent.c
+++ b/libpwdgrp/putpwent.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * putpwent.c - This file is part of the libc-8086/pwd package for ELKS, 2 * putpwent.c - This file is part of the libc-8086/pwd package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
@@ -18,7 +18,7 @@
18 * 18 *
19 */ 19 */
20 20
21#include "busybox.h" 21#include "busybox.h"
22 22
23#include <stdio.h> 23#include <stdio.h>
24#include <errno.h> 24#include <errno.h>
diff --git a/libpwdgrp/pwent.c b/libpwdgrp/pwent.c
index f7f8581f3..1cdb2d454 100644
--- a/libpwdgrp/pwent.c
+++ b/libpwdgrp/pwent.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * pwent.c - This file is part of the libc-8086/pwd package for ELKS, 2 * pwent.c - This file is part of the libc-8086/pwd package for ELKS,
3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>. 3 * Copyright (C) 1995, 1996 Nat Friedman <ndf@linux.mit.edu>.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
diff --git a/libpwdgrp/setgroups.c b/libpwdgrp/setgroups.c
index 449e811dc..15a16f4e6 100644
--- a/libpwdgrp/setgroups.c
+++ b/libpwdgrp/setgroups.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Taken from the set of syscalls for uClibc 3 * Taken from the set of syscalls for uClibc
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Library General Public License as published by 8 * under the terms of the GNU Library General Public License as published by
@@ -20,7 +20,7 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h" 23#include "busybox.h"
24 24
25#include <errno.h> 25#include <errno.h>
26#include <unistd.h> 26#include <unistd.h>
diff --git a/libpwdgrp/shadow.c b/libpwdgrp/shadow.c
index 9e218f96f..b3a4901f5 100644
--- a/libpwdgrp/shadow.c
+++ b/libpwdgrp/shadow.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Copyright 1989 - 1994, Julianne Frances Haugh 3 * Copyright 1989 - 1994, Julianne Frances Haugh
4 * <jockgrrl@austin.rr.com>, <jfh@austin.ibm.com> 4 * <jockgrrl@austin.rr.com>, <jfh@austin.ibm.com>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
@@ -29,8 +29,8 @@
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32/* TODO: fgetspent_r.c getspent_r.c getspnam_r.c sgetspent_r.c 32/* TODO: fgetspent_r.c getspent_r.c getspnam_r.c sgetspent_r.c
33 * lckpwdf ulckpwdf 33 * lckpwdf ulckpwdf
34 */ 34 */
35 35
36#include <stdio.h> 36#include <stdio.h>
@@ -267,7 +267,7 @@ struct spwd *fgetspent(FILE *fp)
267 267
268/* 268/*
269 * putspent - put a (struct spwd *) into the (FILE *) you provide. 269 * putspent - put a (struct spwd *) into the (FILE *) you provide.
270 * 270 *
271 * this was described in shadow_.h but not implemented, so here 271 * this was described in shadow_.h but not implemented, so here
272 * I go. -beppu 272 * I go. -beppu
273 * 273 *
@@ -290,7 +290,7 @@ int putspent(const struct spwd *sp, FILE *fp)
290 sp->sp_min, /* minimum number of days between changes */ 290 sp->sp_min, /* minimum number of days between changes */
291 sp->sp_max, /* maximum number of days between changes */ 291 sp->sp_max, /* maximum number of days between changes */
292 sp->sp_warn, /* number of days of warning before password expires */ 292 sp->sp_warn, /* number of days of warning before password expires */
293 sp->sp_inact, /* number of days after password expires until 293 sp->sp_inact, /* number of days after password expires until
294 the account becomes unusable */ 294 the account becomes unusable */
295 sp->sp_expire, /* days since 1/1/70 until account expires */ 295 sp->sp_expire, /* days since 1/1/70 until account expires */
296 ""); 296 "");
diff --git a/loginutils/Makefile b/loginutils/Makefile
index 3359d5638..a013d141f 100644
--- a/loginutils/Makefile
+++ b/loginutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/loginutils/Makefile.in b/loginutils/Makefile.in
index 160051094..87c0a5c4e 100644
--- a/loginutils/Makefile.in
+++ b/loginutils/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/loginutils/addgroup.c b/loginutils/addgroup.c
index af1cd7a83..cfbd71624 100644
--- a/loginutils/addgroup.c
+++ b/loginutils/addgroup.c
@@ -136,7 +136,7 @@ extern void if_i_am_not_root(void);
136/* 136/*
137 * addgroup will take a login_name as its first parameter. 137 * addgroup will take a login_name as its first parameter.
138 * 138 *
139 * gid 139 * gid
140 * 140 *
141 * can be customized via command-line parameters. 141 * can be customized via command-line parameters.
142 * ________________________________________________________________________ */ 142 * ________________________________________________________________________ */
@@ -157,7 +157,7 @@ int addgroup_main(int argc, char **argv)
157 } else { 157 } else {
158 bb_show_usage(); 158 bb_show_usage();
159 } 159 }
160 160
161 if (optind < argc) { 161 if (optind < argc) {
162 user = argv[optind]; 162 user = argv[optind];
163 optind++; 163 optind++;
diff --git a/loginutils/adduser.c b/loginutils/adduser.c
index c4ab557d0..3e10fd398 100644
--- a/loginutils/adduser.c
+++ b/loginutils/adduser.c
@@ -77,7 +77,7 @@ static int passwd_study(const char *filename, struct passwd *p)
77 if ((p->pw_uid > max) || (p->pw_uid < min)) 77 if ((p->pw_uid > max) || (p->pw_uid < min))
78 p->pw_uid = min; 78 p->pw_uid = min;
79 79
80 /* stuff to do: 80 /* stuff to do:
81 * make sure login isn't taken; 81 * make sure login isn't taken;
82 * find free uid and gid; 82 * find free uid and gid;
83 */ 83 */
@@ -246,7 +246,7 @@ void if_i_am_not_root(void)
246 * 246 *
247 * home 247 * home
248 * shell 248 * shell
249 * gecos 249 * gecos
250 * 250 *
251 * can be customized via command-line parameters. 251 * can be customized via command-line parameters.
252 * ________________________________________________________________________ */ 252 * ________________________________________________________________________ */
diff --git a/loginutils/getty.c b/loginutils/getty.c
index b12b88fb1..0e475e4c0 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -5,13 +5,13 @@
5 be here. Now read the real man-page agetty.8 instead. 5 be here. Now read the real man-page agetty.8 instead.
6 6
7 -f option added by Eric Rasmussen <ear@usfirst.org> - 12/28/95 7 -f option added by Eric Rasmussen <ear@usfirst.org> - 12/28/95
8 8
9 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org> 9 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
10 - added Native Language Support 10 - added Native Language Support
11 11
12 1999-05-05 Thorsten Kranzkowski <dl8bcu@gmx.net> 12 1999-05-05 Thorsten Kranzkowski <dl8bcu@gmx.net>
13 - enable hardware flow control before displaying /etc/issue 13 - enable hardware flow control before displaying /etc/issue
14 14
15*/ 15*/
16 16
17#include <stdio.h> 17#include <stdio.h>
@@ -54,11 +54,11 @@ extern void updwtmp(const char *filename, const struct utmp *ut);
54 54
55 /* 55 /*
56 * Things you may want to modify. 56 * Things you may want to modify.
57 * 57 *
58 * If ISSUE is not defined, agetty will never display the contents of the 58 * If ISSUE is not defined, agetty will never display the contents of the
59 * /etc/issue file. You will not want to spit out large "issue" files at the 59 * /etc/issue file. You will not want to spit out large "issue" files at the
60 * wrong baud rate. Relevant for System V only. 60 * wrong baud rate. Relevant for System V only.
61 * 61 *
62 * You may disagree with the default line-editing etc. characters defined 62 * You may disagree with the default line-editing etc. characters defined
63 * below. Note, however, that DEL cannot be used for interrupt generation 63 * below. Note, however, that DEL cannot be used for interrupt generation
64 * and for line editing at the same time. 64 * and for line editing at the same time.
@@ -386,7 +386,7 @@ static void parse_args(int argc, char **argv, struct options *op)
386 case 'I': 386 case 'I':
387 if (!(op->initstring = strdup(optarg))) 387 if (!(op->initstring = strdup(optarg)))
388 error(bb_msg_memory_exhausted); 388 error(bb_msg_memory_exhausted);
389 389
390 { 390 {
391 const char *p; 391 const char *p;
392 char *q; 392 char *q;
@@ -700,9 +700,9 @@ static void auto_baud(struct termio *tp)
700 * the DCD line, and if the computer is fast enough to set the proper 700 * the DCD line, and if the computer is fast enough to set the proper
701 * baud rate before the message has gone by. We expect a message of the 701 * baud rate before the message has gone by. We expect a message of the
702 * following format: 702 * following format:
703 * 703 *
704 * <junk><number><junk> 704 * <junk><number><junk>
705 * 705 *
706 * The number is interpreted as the baud rate of the incoming call. If the 706 * The number is interpreted as the baud rate of the incoming call. If the
707 * modem does not tell us the baud rate within one second, we will keep 707 * modem does not tell us the baud rate within one second, we will keep
708 * using the current baud rate. It is advisable to enable BREAK 708 * using the current baud rate. It is advisable to enable BREAK
diff --git a/loginutils/login.c b/loginutils/login.c
index ee50a175a..99f66b53b 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -77,7 +77,7 @@ extern int login_main(int argc, char **argv)
77 int opt_preserve = 0; 77 int opt_preserve = 0;
78 int opt_fflag = 0; 78 int opt_fflag = 0;
79 char *opt_host = 0; 79 char *opt_host = 0;
80 int alarmstarted = 0; 80 int alarmstarted = 0;
81#ifdef CONFIG_SELINUX 81#ifdef CONFIG_SELINUX
82 int flask_enabled = is_flask_enabled(); 82 int flask_enabled = is_flask_enabled();
83 security_id_t sid = 0, old_tty_sid, new_tty_sid; 83 security_id_t sid = 0, old_tty_sid, new_tty_sid;
@@ -88,7 +88,7 @@ extern int login_main(int argc, char **argv)
88 signal ( SIGALRM, alarm_handler ); 88 signal ( SIGALRM, alarm_handler );
89 alarm ( TIMEOUT ); 89 alarm ( TIMEOUT );
90 alarmstarted = 1; 90 alarmstarted = 1;
91 91
92 while (( flag = getopt(argc, argv, "f:h:p")) != EOF ) { 92 while (( flag = getopt(argc, argv, "f:h:p")) != EOF ) {
93 switch ( flag ) { 93 switch ( flag ) {
94 case 'p': 94 case 'p':
@@ -104,7 +104,7 @@ extern int login_main(int argc, char **argv)
104 104
105 if ( !amroot ) /* Auth bypass only if real UID is zero */ 105 if ( !amroot ) /* Auth bypass only if real UID is zero */
106 bb_error_msg_and_die ( "-f permission denied" ); 106 bb_error_msg_and_die ( "-f permission denied" );
107 107
108 safe_strncpy(username, optarg, USERNAME_SIZE); 108 safe_strncpy(username, optarg, USERNAME_SIZE);
109 opt_fflag = 1; 109 opt_fflag = 1;
110 break; 110 break;
@@ -119,7 +119,7 @@ extern int login_main(int argc, char **argv)
119 if (optind < argc) // user from command line (getty) 119 if (optind < argc) // user from command line (getty)
120 safe_strncpy(username, argv[optind], USERNAME_SIZE); 120 safe_strncpy(username, argv[optind], USERNAME_SIZE);
121 121
122 if ( !isatty ( 0 ) || !isatty ( 1 ) || !isatty ( 2 )) 122 if ( !isatty ( 0 ) || !isatty ( 1 ) || !isatty ( 2 ))
123 return EXIT_FAILURE; /* Must be a terminal */ 123 return EXIT_FAILURE; /* Must be a terminal */
124 124
125#ifdef CONFIG_FEATURE_U_W_TMP 125#ifdef CONFIG_FEATURE_U_W_TMP
@@ -136,7 +136,7 @@ extern int login_main(int argc, char **argv)
136 if ( amroot ) 136 if ( amroot )
137 memset ( utent.ut_host, 0, sizeof utent.ut_host ); 137 memset ( utent.ut_host, 0, sizeof utent.ut_host );
138#endif 138#endif
139 139
140 if ( opt_host ) { 140 if ( opt_host ) {
141#ifdef CONFIG_FEATURE_U_W_TMP 141#ifdef CONFIG_FEATURE_U_W_TMP
142 safe_strncpy ( utent.ut_host, opt_host, sizeof( utent. ut_host )); 142 safe_strncpy ( utent.ut_host, opt_host, sizeof( utent. ut_host ));
@@ -145,7 +145,7 @@ extern int login_main(int argc, char **argv)
145 } 145 }
146 else 146 else
147 snprintf ( fromhost, sizeof( fromhost ) - 1, " on `%.100s'", tty ); 147 snprintf ( fromhost, sizeof( fromhost ) - 1, " on `%.100s'", tty );
148 148
149 setpgrp(); 149 setpgrp();
150 150
151 openlog ( "login", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH ); 151 openlog ( "login", LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH );
@@ -167,14 +167,14 @@ extern int login_main(int argc, char **argv)
167 pw_copy.pw_passwd = "!"; 167 pw_copy.pw_passwd = "!";
168 opt_fflag = 0; 168 opt_fflag = 0;
169 failed = 1; 169 failed = 1;
170 } else 170 } else
171 pw_copy = *pw; 171 pw_copy = *pw;
172 172
173 pw = &pw_copy; 173 pw = &pw_copy;
174 174
175 if (( pw-> pw_passwd [0] == '!' ) || ( pw-> pw_passwd[0] == '*' )) 175 if (( pw-> pw_passwd [0] == '!' ) || ( pw-> pw_passwd[0] == '*' ))
176 failed = 1; 176 failed = 1;
177 177
178 if ( opt_fflag ) { 178 if ( opt_fflag ) {
179 opt_fflag = 0; 179 opt_fflag = 0;
180 goto auth_ok; 180 goto auth_ok;
@@ -192,14 +192,14 @@ extern int login_main(int argc, char **argv)
192 goto auth_ok; 192 goto auth_ok;
193 193
194 failed = 1; 194 failed = 1;
195 195
196auth_ok: 196auth_ok:
197 if ( !failed) 197 if ( !failed)
198 break; 198 break;
199 199
200 { // delay next try 200 { // delay next try
201 time_t start, now; 201 time_t start, now;
202 202
203 time ( &start ); 203 time ( &start );
204 now = start; 204 now = start;
205 while ( difftime ( now, start ) < FAIL_DELAY) { 205 while ( difftime ( now, start ) < FAIL_DELAY) {
@@ -215,7 +215,7 @@ auth_ok:
215 return EXIT_FAILURE; 215 return EXIT_FAILURE;
216 } 216 }
217 } 217 }
218 218
219 alarm ( 0 ); 219 alarm ( 0 );
220 if ( check_nologin ( pw-> pw_uid == 0 )) 220 if ( check_nologin ( pw-> pw_uid == 0 ))
221 return EXIT_FAILURE; 221 return EXIT_FAILURE;
@@ -253,15 +253,15 @@ auth_ok:
253 sid = 0; 253 sid = 0;
254#endif 254#endif
255 255
256 if ( *tty != '/' ) 256 if ( *tty != '/' )
257 snprintf ( full_tty, sizeof( full_tty ) - 1, "/dev/%s", tty); 257 snprintf ( full_tty, sizeof( full_tty ) - 1, "/dev/%s", tty);
258 else 258 else
259 safe_strncpy ( full_tty, tty, sizeof( full_tty ) - 1 ); 259 safe_strncpy ( full_tty, tty, sizeof( full_tty ) - 1 );
260 260
261 if ( !is_my_tty ( full_tty )) 261 if ( !is_my_tty ( full_tty ))
262 syslog ( LOG_ERR, "unable to determine TTY name, got %s\n", full_tty ); 262 syslog ( LOG_ERR, "unable to determine TTY name, got %s\n", full_tty );
263 263
264 /* Try these, but don't complain if they fail 264 /* Try these, but don't complain if they fail
265 * (for example when the root fs is read only) */ 265 * (for example when the root fs is read only) */
266 chown ( full_tty, pw-> pw_uid, pw-> pw_gid ); 266 chown ( full_tty, pw-> pw_uid, pw-> pw_gid );
267 chmod ( full_tty, 0600 ); 267 chmod ( full_tty, 0600 );
@@ -275,14 +275,14 @@ auth_ok:
275 motd ( ); 275 motd ( );
276 signal ( SIGALRM, SIG_DFL ); /* default alarm signal */ 276 signal ( SIGALRM, SIG_DFL ); /* default alarm signal */
277 277
278 if ( pw-> pw_uid == 0 ) 278 if ( pw-> pw_uid == 0 )
279 syslog ( LOG_INFO, "root login %s\n", fromhost ); 279 syslog ( LOG_INFO, "root login %s\n", fromhost );
280 run_shell ( tmp, 1, 0, 0 280 run_shell ( tmp, 1, 0, 0
281#ifdef CONFIG_SELINUX 281#ifdef CONFIG_SELINUX
282 , sid 282 , sid
283#endif 283#endif
284 ); /* exec the shell finally. */ 284 ); /* exec the shell finally. */
285 285
286 return EXIT_FAILURE; 286 return EXIT_FAILURE;
287} 287}
288 288
@@ -306,7 +306,7 @@ static int login_prompt ( char *buf_name )
306 for ( sp = buf; isspace ( *sp ); sp++ ) { } 306 for ( sp = buf; isspace ( *sp ); sp++ ) { }
307 for ( ep = sp; isgraph ( *ep ); ep++ ) { } 307 for ( ep = sp; isgraph ( *ep ); ep++ ) { }
308 308
309 *ep = 0; 309 *ep = 0;
310 safe_strncpy(buf_name, sp, USERNAME_SIZE); 310 safe_strncpy(buf_name, sp, USERNAME_SIZE);
311 if(buf_name[0]) 311 if(buf_name[0])
312 return 1; 312 return 1;
@@ -332,7 +332,7 @@ static int check_nologin ( int amroot )
332 } 332 }
333 if ( !amroot ) 333 if ( !amroot )
334 return 1; 334 return 1;
335 335
336 puts ( "\r\n[Disconnect bypassed -- root login allowed.]\r" ); 336 puts ( "\r\n[Disconnect bypassed -- root login allowed.]\r" );
337 } 337 }
338 return 0; 338 return 0;
@@ -377,7 +377,7 @@ static int is_my_tty ( const char *tty )
377 377
378 if ( stat ( tty, &by_name ) || fstat ( 0, &by_fd )) 378 if ( stat ( tty, &by_name ) || fstat ( 0, &by_fd ))
379 return 0; 379 return 0;
380 380
381 if ( by_name. st_rdev != by_fd. st_rdev ) 381 if ( by_name. st_rdev != by_fd. st_rdev )
382 return 0; 382 return 0;
383 else 383 else
@@ -391,8 +391,8 @@ static void motd ( )
391 register int c; 391 register int c;
392 392
393 if (( fp = fopen ( bb_path_motd_file, "r" ))) { 393 if (( fp = fopen ( bb_path_motd_file, "r" ))) {
394 while (( c = getc ( fp )) != EOF ) 394 while (( c = getc ( fp )) != EOF )
395 putchar ( c ); 395 putchar ( c );
396 fclose ( fp ); 396 fclose ( fp );
397 } 397 }
398} 398}
diff --git a/loginutils/su.c b/loginutils/su.c
index 2d7a7ac05..ec0c16c7d 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -84,12 +84,12 @@ int su_main ( int argc, char **argv )
84 } 84 }
85 85
86 /* get user if specified */ 86 /* get user if specified */
87 if ( optind < argc ) 87 if ( optind < argc )
88 opt_username = argv [optind++]; 88 opt_username = argv [optind++];
89 89
90 if ( optind < argc ) 90 if ( optind < argc )
91 opt_args = argv + optind; 91 opt_args = argv + optind;
92 92
93#if defined( SYSLOG_SUCCESS ) || defined( SYSLOG_FAILURE ) 93#if defined( SYSLOG_SUCCESS ) || defined( SYSLOG_FAILURE )
94#ifdef CONFIG_FEATURE_U_W_TMP 94#ifdef CONFIG_FEATURE_U_W_TMP
95 /* The utmp entry (via getlogin) is probably the best way to identify 95 /* The utmp entry (via getlogin) is probably the best way to identify
@@ -108,11 +108,11 @@ int su_main ( int argc, char **argv )
108 108
109 openlog ( bb_applet_name, 0, LOG_AUTH ); 109 openlog ( bb_applet_name, 0, LOG_AUTH );
110#endif 110#endif
111 111
112 pw = getpwnam ( opt_username ); 112 pw = getpwnam ( opt_username );
113 if ( !pw ) 113 if ( !pw )
114 bb_error_msg_and_die ( "user %s does not exist", opt_username ); 114 bb_error_msg_and_die ( "user %s does not exist", opt_username );
115 115
116 /* Make sure pw->pw_shell is non-NULL. It may be NULL when NEW_USER 116 /* Make sure pw->pw_shell is non-NULL. It may be NULL when NEW_USER
117 is a username that is retrieved via NIS (YP), but that doesn't have 117 is a username that is retrieved via NIS (YP), but that doesn't have
118 a default shell listed. */ 118 a default shell listed. */
@@ -145,13 +145,13 @@ int su_main ( int argc, char **argv )
145 if ( !opt_shell ) 145 if ( !opt_shell )
146 opt_shell = pw->pw_shell; 146 opt_shell = pw->pw_shell;
147 147
148 change_identity ( pw ); 148 change_identity ( pw );
149 setup_environment ( opt_shell, opt_loginshell, !opt_preserve, pw ); 149 setup_environment ( opt_shell, opt_loginshell, !opt_preserve, pw );
150 run_shell ( opt_shell, opt_loginshell, opt_command, (const char**)opt_args 150 run_shell ( opt_shell, opt_loginshell, opt_command, (const char**)opt_args
151#ifdef CONFIG_SELINUX 151#ifdef CONFIG_SELINUX
152 , 0 152 , 0
153#endif 153#endif
154 ); 154 );
155 155
156 return EXIT_FAILURE; 156 return EXIT_FAILURE;
157} 157}
diff --git a/miscutils/Config.in b/miscutils/Config.in
index c5327c201..7e18c16a0 100644
--- a/miscutils/Config.in
+++ b/miscutils/Config.in
@@ -86,11 +86,11 @@ config CONFIG_HDPARM
86 default n 86 default n
87 help 87 help
88 Get/Set hard drive parameters. Primarily intended for ATA 88 Get/Set hard drive parameters. Primarily intended for ATA
89 drives. Adds about 13k (or around 30k if you enable the 89 drives. Adds about 13k (or around 30k if you enable the
90 CONFIG_FEATURE_HDPARM_GET_IDENTITY option).... 90 CONFIG_FEATURE_HDPARM_GET_IDENTITY option)....
91 91
92config CONFIG_FEATURE_HDPARM_GET_IDENTITY 92config CONFIG_FEATURE_HDPARM_GET_IDENTITY
93 bool " Support obtaining detailed information directly from drives" 93 bool " Support obtaining detailed information directly from drives"
94 default y 94 default y
95 depends on CONFIG_HDPARM 95 depends on CONFIG_HDPARM
96 help 96 help
@@ -99,7 +99,7 @@ config CONFIG_FEATURE_HDPARM_GET_IDENTITY
99 feature set. Enabling this option will add about 16k... 99 feature set. Enabling this option will add about 16k...
100 100
101config CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF 101config CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF
102 bool " Register an IDE interface (DANGEROUS)" 102 bool " Register an IDE interface (DANGEROUS)"
103 default n 103 default n
104 depends on CONFIG_HDPARM 104 depends on CONFIG_HDPARM
105 help 105 help
@@ -107,7 +107,7 @@ config CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF
107 This is dangerous stuff, so you should probably say N. 107 This is dangerous stuff, so you should probably say N.
108 108
109config CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF 109config CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF
110 bool " Un-register an IDE interface (DANGEROUS)" 110 bool " Un-register an IDE interface (DANGEROUS)"
111 default n 111 default n
112 depends on CONFIG_HDPARM 112 depends on CONFIG_HDPARM
113 help 113 help
@@ -115,7 +115,7 @@ config CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF
115 This is dangerous stuff, so you should probably say N. 115 This is dangerous stuff, so you should probably say N.
116 116
117config CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET 117config CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET
118 bool " perform device reset (DANGEROUS)" 118 bool " perform device reset (DANGEROUS)"
119 default n 119 default n
120 depends on CONFIG_HDPARM 120 depends on CONFIG_HDPARM
121 help 121 help
@@ -123,7 +123,7 @@ config CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET
123 This is dangerous stuff, so you should probably say N. 123 This is dangerous stuff, so you should probably say N.
124 124
125config CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF 125config CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF
126 bool " tristate device for hotswap (DANGEROUS)" 126 bool " tristate device for hotswap (DANGEROUS)"
127 default n 127 default n
128 depends on CONFIG_HDPARM 128 depends on CONFIG_HDPARM
129 help 129 help
diff --git a/miscutils/Makefile b/miscutils/Makefile
index 374ce68f8..4bae72476 100644
--- a/miscutils/Makefile
+++ b/miscutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/miscutils/Makefile.in b/miscutils/Makefile.in
index fea9b8926..89e3208a6 100644
--- a/miscutils/Makefile.in
+++ b/miscutils/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index e941f6b4f..110c02654 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -76,7 +76,7 @@ static char *ret_code_descript[] = {
76#else 76#else
77void usage(char *prog) 77void usage(char *prog)
78{ 78{
79 fprintf(stderr, 79 fprintf(stderr,
80 "Usage: %s [ -q ] [ -o offset ] [ -f frequency ] [ -p timeconstant ] [ -t tick ]\n", 80 "Usage: %s [ -q ] [ -o offset ] [ -f frequency ] [ -p timeconstant ] [ -t tick ]\n",
81 prog); 81 prog);
82} 82}
@@ -126,7 +126,7 @@ int main(int argc, char ** argv)
126 ret = adjtimex(&txc); 126 ret = adjtimex(&txc);
127 127
128 if (ret < 0) perror("adjtimex"); 128 if (ret < 0) perror("adjtimex");
129 129
130 if (!quiet && ret>=0) { 130 if (!quiet && ret>=0) {
131 printf( 131 printf(
132 " mode: %d\n" 132 " mode: %d\n"
diff --git a/miscutils/dc.c b/miscutils/dc.c
index f574ae4a0..0ac658d9c 100644
--- a/miscutils/dc.c
+++ b/miscutils/dc.c
@@ -87,7 +87,7 @@ static void not(void)
87 87
88static void set_output_base(void) 88static void set_output_base(void)
89{ 89{
90 base=(unsigned char)pop(); 90 base=(unsigned char)pop();
91 if ((base != 10) && (base != 16)) { 91 if ((base != 10) && (base != 16)) {
92 fprintf(stderr, "Error: base = %d is not supported.\n", base); 92 fprintf(stderr, "Error: base = %d is not supported.\n", base);
93 base=10; 93 base=10;
@@ -96,7 +96,7 @@ static void set_output_base(void)
96 96
97static void print_base(double print) 97static void print_base(double print)
98{ 98{
99 if (base == 16) 99 if (base == 16)
100 printf("%x\n", (unsigned int)print); 100 printf("%x\n", (unsigned int)print);
101 else 101 else
102 printf("%g\n", print); 102 printf("%g\n", print);
@@ -178,7 +178,7 @@ static void stack_machine(const char *argument)
178} 178}
179 179
180/* return pointer to next token in buffer and set *buffer to one char 180/* return pointer to next token in buffer and set *buffer to one char
181 * past the end of the above mentioned token 181 * past the end of the above mentioned token
182 */ 182 */
183static char *get_token(char **buffer) 183static char *get_token(char **buffer)
184{ 184{
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 5c91b522d..eaa61c102 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -606,7 +606,7 @@ static uint8_t mode_loop(uint16_t mode_sup, uint16_t mode_sel, int cc, uint8_t *
606static void print_ascii(uint16_t *p, uint8_t length) { 606static void print_ascii(uint16_t *p, uint8_t length) {
607 uint8_t ii; 607 uint8_t ii;
608 char cl; 608 char cl;
609 609
610 /* find first non-space & print it */ 610 /* find first non-space & print it */
611 for(ii = 0; ii< length; ii++) 611 for(ii = 0; ii< length; ii++)
612 { 612 {
@@ -1080,7 +1080,7 @@ static void identify (uint16_t *id_supplied, const char *devname)
1080 if_printf(((dev == ATAPI_DEV) && (eqpt != CDROM) && (val[CAPAB_0] & DMA_IL_SUP)), 1080 if_printf(((dev == ATAPI_DEV) && (eqpt != CDROM) && (val[CAPAB_0] & DMA_IL_SUP)),
1081 "\t Interleaved DMA support\n"); 1081 "\t Interleaved DMA support\n");
1082 1082
1083 if((val[WHATS_VALID] & OK_W64_70) && 1083 if((val[WHATS_VALID] & OK_W64_70) &&
1084 (val[DMA_TIME_MIN] || val[DMA_TIME_NORM])) 1084 (val[DMA_TIME_MIN] || val[DMA_TIME_NORM]))
1085 { 1085 {
1086 printf("\t Cycle time:"); 1086 printf("\t Cycle time:");
@@ -1241,7 +1241,7 @@ static int do_ctimings, do_timings = 0;
1241static unsigned long set_readahead= 0, get_readahead= 0, bbreadahead= 0; 1241static unsigned long set_readahead= 0, get_readahead= 0, bbreadahead= 0;
1242static unsigned long set_readonly = 0, get_readonly = 0, readonly = 0; 1242static unsigned long set_readonly = 0, get_readonly = 0, readonly = 0;
1243static unsigned long set_unmask = 0, get_unmask = 0, unmask = 0; 1243static unsigned long set_unmask = 0, get_unmask = 0, unmask = 0;
1244static unsigned long set_mult = 0, get_mult = 0, mult = 0; 1244static unsigned long set_mult = 0, get_mult = 0, mult = 0;
1245#ifdef CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA 1245#ifdef CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA
1246static unsigned long set_dma = 0, get_dma = 0, dma = 0; 1246static unsigned long set_dma = 0, get_dma = 0, dma = 0;
1247#endif 1247#endif
diff --git a/miscutils/last.c b/miscutils/last.c
index e7f9eb57a..86613bf27 100644
--- a/miscutils/last.c
+++ b/miscutils/last.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * last implementation for busybox 3 * last implementation for busybox
4 * 4 *
5 * Copyright (C) 2003 Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 2003-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -68,10 +68,10 @@ extern int last_main(int argc, char **argv)
68 else if (strncmp(ut.ut_user, "runlevel", 7) == 0) 68 else if (strncmp(ut.ut_user, "runlevel", 7) == 0)
69 ut.ut_type = RUN_LVL; 69 ut.ut_type = RUN_LVL;
70 } else { 70 } else {
71 if (!ut.ut_name[0] || strcmp(ut.ut_name, "LOGIN") == 0 || 71 if (!ut.ut_name[0] || strcmp(ut.ut_name, "LOGIN") == 0 ||
72 ut.ut_name[0] == 0) 72 ut.ut_name[0] == 0)
73 { 73 {
74 /* Don't bother. This means we can't find how long 74 /* Don't bother. This means we can't find how long
75 * someone was logged in for. Oh well. */ 75 * someone was logged in for. Oh well. */
76 continue; 76 continue;
77 } 77 }
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index 308d651ae..45498bb1d 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -1,9 +1,9 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * public domain -- Dave 'Kill a Cop' Cinege <dcinege@psychosis.com> 3 * public domain -- Dave 'Kill a Cop' Cinege <dcinege@psychosis.com>
4 * 4 *
5 * makedevs 5 * makedevs
6 * Make ranges of device files quickly. 6 * Make ranges of device files quickly.
7 * known bugs: can't deal with alpha ranges 7 * known bugs: can't deal with alpha ranges
8 */ 8 */
9 9
diff --git a/miscutils/mt.c b/miscutils/mt.c
index e79954552..b0cdaccb9 100644
--- a/miscutils/mt.c
+++ b/miscutils/mt.c
@@ -57,7 +57,7 @@ extern int mt_main(int argc, char **argv)
57 struct mtop op; 57 struct mtop op;
58 struct mtpos position; 58 struct mtpos position;
59 int fd, mode; 59 int fd, mode;
60 60
61 if (argc < 2) { 61 if (argc < 2) {
62 bb_show_usage(); 62 bb_show_usage();
63 } 63 }
diff --git a/miscutils/rx.c b/miscutils/rx.c
index 2b16f2e22..8edc8877a 100644
--- a/miscutils/rx.c
+++ b/miscutils/rx.c
@@ -1,14 +1,14 @@
1/*------------------------------------------------------------------------- 1/*-------------------------------------------------------------------------
2 * Filename: xmodem.c 2 * Filename: xmodem.c
3 * Version: $Id: rx.c,v 1.1 2003/12/20 07:30:35 bug1 Exp $ 3 * Version: $Id: rx.c,v 1.2 2004/03/15 08:28:46 andersen Exp $
4 * Copyright: Copyright (C) 2001, Hewlett-Packard Company 4 * Copyright: Copyright (C) 2001, Hewlett-Packard Company
5 * Author: Christopher Hoover <ch@hpl.hp.com> 5 * Author: Christopher Hoover <ch@hpl.hp.com>
6 * Description: xmodem functionality for uploading of kernels 6 * Description: xmodem functionality for uploading of kernels
7 * and the like 7 * and the like
8 * Created at: Thu Dec 20 01:58:08 PST 2001 8 * Created at: Thu Dec 20 01:58:08 PST 2001
9 *-----------------------------------------------------------------------*/ 9 *-----------------------------------------------------------------------*/
10/* 10/*
11 * xmodem.c: xmodem functionality for uploading of kernels and 11 * xmodem.c: xmodem functionality for uploading of kernels and
12 * the like 12 * the like
13 * 13 *
14 * Copyright (C) 2001 Hewlett-Packard Laboratories 14 * Copyright (C) 2001 Hewlett-Packard Laboratories
@@ -69,7 +69,7 @@ Cf:
69#define TIMEOUT_LONG 10 69#define TIMEOUT_LONG 10
70#define MAXERRORS 10 70#define MAXERRORS 10
71 71
72static inline void write_byte(int fd, char cc) { 72static inline void write_byte(int fd, char cc) {
73 write(fd, &cc, 1); 73 write(fd, &cc, 1);
74} 74}
75 75
@@ -80,7 +80,7 @@ static inline void write_flush(int fd) {
80static inline void read_flush(int fd) { 80static inline void read_flush(int fd) {
81 tcflush(fd, TCIFLUSH); 81 tcflush(fd, TCIFLUSH);
82} 82}
83 83
84static int read_byte(int fd, unsigned int timeout) { 84static int read_byte(int fd, unsigned int timeout) {
85 char buf[1]; 85 char buf[1];
86 int n; 86 int n;
@@ -312,12 +312,12 @@ int rx_main(int argc, char **argv)
312 312
313 if (tcgetattr(ttyfd, &tty) < 0) 313 if (tcgetattr(ttyfd, &tty) < 0)
314 bb_error_msg_and_die("%s: tcgetattr failed: %m\n", argv[0]); 314 bb_error_msg_and_die("%s: tcgetattr failed: %m\n", argv[0]);
315 315
316 orig_tty = tty; 316 orig_tty = tty;
317 317
318 cfmakeraw(&tty); 318 cfmakeraw(&tty);
319 tcsetattr(ttyfd, TCSAFLUSH, &tty); 319 tcsetattr(ttyfd, TCSAFLUSH, &tty);
320 320
321 memset(&act, 0, sizeof(act)); 321 memset(&act, 0, sizeof(act));
322 act.sa_handler = sigalrm_handler; 322 act.sa_handler = sigalrm_handler;
323 sigaction(SIGALRM, &act, 0); 323 sigaction(SIGALRM, &act, 0);
diff --git a/miscutils/strings.c b/miscutils/strings.c
index 4778cfb5f..5dcd876e9 100644
--- a/miscutils/strings.c
+++ b/miscutils/strings.c
@@ -136,7 +136,7 @@ pipe:
136 * documentation and/or other materials provided with the distribution. 136 * documentation and/or other materials provided with the distribution.
137 * 137 *
138 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 138 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
139 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 139 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
140 * 140 *
141 * 4. Neither the name of the University nor the names of its contributors 141 * 4. Neither the name of the University nor the names of its contributors
142 * may be used to endorse or promote products derived from this software 142 * may be used to endorse or promote products derived from this software
diff --git a/miscutils/time.c b/miscutils/time.c
index 7aaa12e2a..ca896a1c5 100644
--- a/miscutils/time.c
+++ b/miscutils/time.c
@@ -17,7 +17,7 @@
17 02111-1307, USA. */ 17 02111-1307, USA. */
18 18
19/* Originally written by David Keppel <pardo@cs.washington.edu>. 19/* Originally written by David Keppel <pardo@cs.washington.edu>.
20 Heavily modified by David MacKenzie <djm@gnu.ai.mit.edu>. 20 Heavily modified by David MacKenzie <djm@gnu.ai.mit.edu>.
21 Heavily modified for busybox by Erik Andersen <andersen@codepoet.org> 21 Heavily modified for busybox by Erik Andersen <andersen@codepoet.org>
22 */ 22 */
23 23
diff --git a/miscutils/watchdog.c b/miscutils/watchdog.c
index b1167dc90..276fadebd 100644
--- a/miscutils/watchdog.c
+++ b/miscutils/watchdog.c
@@ -67,7 +67,7 @@ extern int watchdog_main(int argc, char **argv)
67 fd = bb_xopen(argv[argc - 1], O_WRONLY); 67 fd = bb_xopen(argv[argc - 1], O_WRONLY);
68 68
69 while (1) { 69 while (1) {
70 /* 70 /*
71 * Make sure we clear the counter before sleeping, as the counter value 71 * Make sure we clear the counter before sleeping, as the counter value
72 * is undefined at this point -- PFM 72 * is undefined at this point -- PFM
73 */ 73 */
diff --git a/modutils/Config.in b/modutils/Config.in
index d9f76d1b4..faccee88f 100644
--- a/modutils/Config.in
+++ b/modutils/Config.in
@@ -45,9 +45,9 @@ config CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS
45 default n 45 default n
46 depends on CONFIG_INSMOD && ( CONFIG_FEATURE_2_2_MODULES || CONFIG_FEATURE_2_4_MODULES ) 46 depends on CONFIG_INSMOD && ( CONFIG_FEATURE_2_2_MODULES || CONFIG_FEATURE_2_4_MODULES )
47 help 47 help
48 By adding module symbols to the kernel symbol table, Oops messages 48 By adding module symbols to the kernel symbol table, Oops messages
49 occuring within kernel modules can be properly debugged. By enabling 49 occuring within kernel modules can be properly debugged. By enabling
50 this feature, module symbols will always be added to the kernel symbol 50 this feature, module symbols will always be added to the kernel symbol
51 table for properly debugging support. If you are not interested in 51 table for properly debugging support. If you are not interested in
52 Oops messages from kernel modules, say N. 52 Oops messages from kernel modules, say N.
53 53
@@ -62,7 +62,7 @@ config CONFIG_FEATURE_INSMOD_LOADINKMEM
62 being loaded into memory. 62 being loaded into memory.
63 63
64config CONFIG_FEATURE_INSMOD_LOAD_MAP 64config CONFIG_FEATURE_INSMOD_LOAD_MAP
65 bool " Enable load map (-m) option" 65 bool " Enable load map (-m) option"
66 default n 66 default n
67 depends on CONFIG_INSMOD && ( CONFIG_FEATURE_2_2_MODULES || CONFIG_FEATURE_2_4_MODULES ) 67 depends on CONFIG_INSMOD && ( CONFIG_FEATURE_2_2_MODULES || CONFIG_FEATURE_2_4_MODULES )
68 help 68 help
@@ -78,7 +78,7 @@ config CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL
78 depends on CONFIG_FEATURE_INSMOD_LOAD_MAP 78 depends on CONFIG_FEATURE_INSMOD_LOAD_MAP
79 help 79 help
80 Without this option, -m will only output section 80 Without this option, -m will only output section
81 load map. With this option, -m will also output 81 load map. With this option, -m will also output
82 symbols load map. 82 symbols load map.
83 83
84config CONFIG_LSMOD 84config CONFIG_LSMOD
@@ -100,7 +100,7 @@ config CONFIG_MODPROBE
100 bool "modprobe" 100 bool "modprobe"
101 default n 101 default n
102 help 102 help
103 Handle the loading of modules, and their dependancies on a high 103 Handle the loading of modules, and their dependancies on a high
104 level. 104 level.
105 105
106config CONFIG_RMMOD 106config CONFIG_RMMOD
diff --git a/modutils/Makefile b/modutils/Makefile
index 646e4489e..5e1c886c0 100644
--- a/modutils/Makefile
+++ b/modutils/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/modutils/Makefile.in b/modutils/Makefile.in
index f6d5887fc..a92befafb 100644
--- a/modutils/Makefile.in
+++ b/modutils/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 73259131b..eaa425f5d 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -2,11 +2,10 @@
2/* 2/*
3 * Mini insmod implementation for busybox 3 * Mini insmod implementation for busybox
4 * 4 *
5 * This version of insmod supports x86, ARM, SH3/4/5, powerpc, m68k, 5 * This version of insmod supports x86, ARM, SH3/4/5, powerpc, m68k,
6 * MIPS, and v850e. 6 * MIPS, and v850e.
7 * 7 *
8 * Copyright (C) 1999,2000 by Lineo, inc. and Erik Andersen 8 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
9 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
10 * and Ron Alder <alder@lineo.com> 9 * and Ron Alder <alder@lineo.com>
11 * 10 *
12 * Miles Bader <miles@gnu.org> added NEC V850E support. 11 * Miles Bader <miles@gnu.org> added NEC V850E support.
@@ -32,7 +31,7 @@
32 * These blocks should be easy maintain and sync with obj_xxx.c in modutils. 31 * These blocks should be easy maintain and sync with obj_xxx.c in modutils.
33 * 32 *
34 * Magnus Damm <damm@opensource.se> added PowerPC support 20-Feb-2001. 33 * Magnus Damm <damm@opensource.se> added PowerPC support 20-Feb-2001.
35 * PowerPC specific code stolen from modutils-2.3.16, 34 * PowerPC specific code stolen from modutils-2.3.16,
36 * written by Paul Mackerras, Copyright 1996, 1997 Linux International. 35 * written by Paul Mackerras, Copyright 1996, 1997 Linux International.
37 * I've only tested the code on mpc8xx platforms in big-endian mode. 36 * I've only tested the code on mpc8xx platforms in big-endian mode.
38 * Did some cleanup and added CONFIG_USE_xxx_ENTRIES... 37 * Did some cleanup and added CONFIG_USE_xxx_ENTRIES...
@@ -104,7 +103,7 @@ extern int insmod_ng_main( int argc, char **argv);
104#endif 103#endif
105 104
106#ifdef CONFIG_FEATURE_INSMOD_LOADINKMEM 105#ifdef CONFIG_FEATURE_INSMOD_LOADINKMEM
107#define LOADBITS 0 106#define LOADBITS 0
108#else 107#else
109#define LOADBITS 1 108#define LOADBITS 1
110#endif 109#endif
@@ -152,7 +151,7 @@ extern int insmod_ng_main( int argc, char **argv);
152#define ELFCLASSM ELFCLASS32 151#define ELFCLASSM ELFCLASS32
153#endif 152#endif
154 153
155#if defined(__mc68000__) 154#if defined(__mc68000__)
156#define CONFIG_USE_GOT_ENTRIES 155#define CONFIG_USE_GOT_ENTRIES
157#define CONFIG_GOT_ENTRY_SIZE 4 156#define CONFIG_GOT_ENTRY_SIZE 4
158#define CONFIG_USE_SINGLE 157#define CONFIG_USE_SINGLE
@@ -183,7 +182,7 @@ extern int insmod_ng_main( int argc, char **argv);
183#define CONFIG_USE_PLT_ENTRIES 182#define CONFIG_USE_PLT_ENTRIES
184#define CONFIG_PLT_ENTRY_SIZE 16 183#define CONFIG_PLT_ENTRY_SIZE 16
185#define CONFIG_USE_PLT_LIST 184#define CONFIG_USE_PLT_LIST
186#define CONFIG_LIST_ARCHTYPE ElfW(Addr) 185#define CONFIG_LIST_ARCHTYPE ElfW(Addr)
187#define CONFIG_USE_LIST 186#define CONFIG_USE_LIST
188 187
189#define MATCH_MACHINE(x) (x == EM_PPC) 188#define MATCH_MACHINE(x) (x == EM_PPC)
@@ -282,7 +281,7 @@ extern int insmod_ng_main( int argc, char **argv);
282#ifndef MODUTILS_MODULE_H 281#ifndef MODUTILS_MODULE_H
283static const int MODUTILS_MODULE_H = 1; 282static const int MODUTILS_MODULE_H = 1;
284 283
285#ident "$Id: insmod.c,v 1.112 2004/02/18 10:14:17 mjn3 Exp $" 284#ident "$Id: insmod.c,v 1.113 2004/03/15 08:28:47 andersen Exp $"
286 285
287/* This file contains the structures used by the 2.0 and 2.1 kernels. 286/* This file contains the structures used by the 2.0 and 2.1 kernels.
288 We do not use the kernel headers directly because we do not wish 287 We do not use the kernel headers directly because we do not wish
@@ -503,7 +502,7 @@ int delete_module(const char *);
503#ifndef MODUTILS_OBJ_H 502#ifndef MODUTILS_OBJ_H
504static const int MODUTILS_OBJ_H = 1; 503static const int MODUTILS_OBJ_H = 1;
505 504
506#ident "$Id: insmod.c,v 1.112 2004/02/18 10:14:17 mjn3 Exp $" 505#ident "$Id: insmod.c,v 1.113 2004/03/15 08:28:47 andersen Exp $"
507 506
508/* The relocatable object is manipulated using elfin types. */ 507/* The relocatable object is manipulated using elfin types. */
509 508
@@ -680,7 +679,7 @@ static enum obj_reloc arch_apply_relocation (struct obj_file *f,
680static void arch_create_got (struct obj_file *f); 679static void arch_create_got (struct obj_file *f);
681 680
682static int obj_gpl_license(struct obj_file *f, const char **license); 681static int obj_gpl_license(struct obj_file *f, const char **license);
683 682
684#ifdef CONFIG_FEATURE_2_4_MODULES 683#ifdef CONFIG_FEATURE_2_4_MODULES
685static int arch_init_module (struct obj_file *f, struct new_module *); 684static int arch_init_module (struct obj_file *f, struct new_module *);
686#endif 685#endif
@@ -888,8 +887,8 @@ arch_apply_relocation(struct obj_file *f,
888 goto bb_use_got; 887 goto bb_use_got;
889 888
890 case R_ARM_GOTPC: 889 case R_ARM_GOTPC:
891 /* relative reloc, always to _GLOBAL_OFFSET_TABLE_ 890 /* relative reloc, always to _GLOBAL_OFFSET_TABLE_
892 * (which is .got) similar to branch, 891 * (which is .got) similar to branch,
893 * but is full 32 bits relative */ 892 * but is full 32 bits relative */
894 893
895 assert(got); 894 assert(got);
@@ -922,7 +921,7 @@ arch_apply_relocation(struct obj_file *f,
922 case R_390_PC16DBL: 921 case R_390_PC16DBL:
923 *(unsigned short *) loc += (v - dot) >> 1; 922 *(unsigned short *) loc += (v - dot) >> 1;
924 break; 923 break;
925 case R_390_PC16: 924 case R_390_PC16:
926 *(unsigned short *) loc += v - dot; 925 *(unsigned short *) loc += v - dot;
927 break; 926 break;
928 927
@@ -933,7 +932,7 @@ arch_apply_relocation(struct obj_file *f,
933 pe = (struct arch_single_entry *) &isym->pltent; 932 pe = (struct arch_single_entry *) &isym->pltent;
934 assert(pe->allocated); 933 assert(pe->allocated);
935 if (pe->inited == 0) { 934 if (pe->inited == 0) {
936 ip = (unsigned long *)(ifile->plt->contents + pe->offset); 935 ip = (unsigned long *)(ifile->plt->contents + pe->offset);
937 ip[0] = 0x0d105810; /* basr 1,0; lg 1,10(1); br 1 */ 936 ip[0] = 0x0d105810; /* basr 1,0; lg 1,10(1); br 1 */
938 ip[1] = 0x100607f1; 937 ip[1] = 0x100607f1;
939 if (ELF32_R_TYPE(rel->r_info) == R_390_PLT16DBL) 938 if (ELF32_R_TYPE(rel->r_info) == R_390_PLT16DBL)
@@ -984,7 +983,7 @@ arch_apply_relocation(struct obj_file *f,
984 break; 983 break;
985 984
986#ifndef R_390_GOTOFF32 985#ifndef R_390_GOTOFF32
987#define R_390_GOTOFF32 R_390_GOTOFF 986#define R_390_GOTOFF32 R_390_GOTOFF
988#endif 987#endif
989 case R_390_GOTOFF32: 988 case R_390_GOTOFF32:
990 assert(got != 0); 989 assert(got != 0);
@@ -1052,7 +1051,7 @@ arch_apply_relocation(struct obj_file *f,
1052 1051
1053 case R_68K_PC8: 1052 case R_68K_PC8:
1054 v -= dot; 1053 v -= dot;
1055 if ((Elf32_Sword)v > 0x7f || 1054 if ((Elf32_Sword)v > 0x7f ||
1056 (Elf32_Sword)v < -(Elf32_Sword)0x80) { 1055 (Elf32_Sword)v < -(Elf32_Sword)0x80) {
1057 ret = obj_reloc_overflow; 1056 ret = obj_reloc_overflow;
1058 } 1057 }
@@ -1061,7 +1060,7 @@ arch_apply_relocation(struct obj_file *f,
1061 1060
1062 case R_68K_PC16: 1061 case R_68K_PC16:
1063 v -= dot; 1062 v -= dot;
1064 if ((Elf32_Sword)v > 0x7fff || 1063 if ((Elf32_Sword)v > 0x7fff ||
1065 (Elf32_Sword)v < -(Elf32_Sword)0x8000) { 1064 (Elf32_Sword)v < -(Elf32_Sword)0x8000) {
1066 ret = obj_reloc_overflow; 1065 ret = obj_reloc_overflow;
1067 } 1066 }
@@ -1365,7 +1364,7 @@ bb_use_plt:
1365 v -= dot; 1364 v -= dot;
1366 /* if the target is too far away.... */ 1365 /* if the target is too far away.... */
1367#if defined (__arm__) || defined (__powerpc__) 1366#if defined (__arm__) || defined (__powerpc__)
1368 if ((int)v < -0x02000000 || (int)v >= 0x02000000) 1367 if ((int)v < -0x02000000 || (int)v >= 0x02000000)
1369#elif defined (__v850e__) 1368#elif defined (__v850e__)
1370 if ((Elf32_Sword)v > 0x1fffff || (Elf32_Sword)v < (Elf32_Sword)-0x200000) 1369 if ((Elf32_Sword)v > 0x1fffff || (Elf32_Sword)v < (Elf32_Sword)-0x200000)
1371#endif 1370#endif
@@ -1426,7 +1425,7 @@ bb_use_got:
1426} 1425}
1427 1426
1428 1427
1429#if defined(CONFIG_USE_LIST) 1428#if defined(CONFIG_USE_LIST)
1430 1429
1431static int arch_list_add(ElfW(RelM) *rel, struct arch_list_entry **list, 1430static int arch_list_add(ElfW(RelM) *rel, struct arch_list_entry **list,
1432 int offset, int size) 1431 int offset, int size)
@@ -1453,7 +1452,7 @@ static int arch_list_add(ElfW(RelM) *rel, struct arch_list_entry **list,
1453 1452
1454#endif 1453#endif
1455 1454
1456#if defined(CONFIG_USE_SINGLE) 1455#if defined(CONFIG_USE_SINGLE)
1457 1456
1458static int arch_single_init(ElfW(RelM) *rel, struct arch_single_entry *single, 1457static int arch_single_init(ElfW(RelM) *rel, struct arch_single_entry *single,
1459 int offset, int size) 1458 int offset, int size)
@@ -1471,7 +1470,7 @@ static int arch_single_init(ElfW(RelM) *rel, struct arch_single_entry *single,
1471 1470
1472#if defined(CONFIG_USE_GOT_ENTRIES) || defined(CONFIG_USE_PLT_ENTRIES) 1471#if defined(CONFIG_USE_GOT_ENTRIES) || defined(CONFIG_USE_PLT_ENTRIES)
1473 1472
1474static struct obj_section *arch_xsect_init(struct obj_file *f, char *name, 1473static struct obj_section *arch_xsect_init(struct obj_file *f, char *name,
1475 int offset, int size) 1474 int offset, int size)
1476{ 1475{
1477 struct obj_section *myrelsec = obj_find_section(f, name); 1476 struct obj_section *myrelsec = obj_find_section(f, name);
@@ -1483,7 +1482,7 @@ static struct obj_section *arch_xsect_init(struct obj_file *f, char *name,
1483 if (myrelsec) { 1482 if (myrelsec) {
1484 obj_extend_section(myrelsec, offset); 1483 obj_extend_section(myrelsec, offset);
1485 } else { 1484 } else {
1486 myrelsec = obj_create_alloced_section(f, name, 1485 myrelsec = obj_create_alloced_section(f, name,
1487 size, offset); 1486 size, offset);
1488 assert(myrelsec); 1487 assert(myrelsec);
1489 } 1488 }
@@ -1575,7 +1574,7 @@ static void arch_create_got(struct obj_file *f)
1575 1574
1576#elif defined(__sh__) 1575#elif defined(__sh__)
1577 case R_SH_GOT32: 1576 case R_SH_GOT32:
1578 got_allocate = 1; 1577 got_allocate = 1;
1579 break; 1578 break;
1580 1579
1581 case R_SH_GOTPC: 1580 case R_SH_GOTPC:
@@ -1602,7 +1601,7 @@ static void arch_create_got(struct obj_file *f)
1602#if defined(CONFIG_USE_GOT_ENTRIES) 1601#if defined(CONFIG_USE_GOT_ENTRIES)
1603 if (got_allocate) { 1602 if (got_allocate) {
1604 got_offset += arch_single_init( 1603 got_offset += arch_single_init(
1605 rel, &intsym->gotent, 1604 rel, &intsym->gotent,
1606 got_offset, CONFIG_GOT_ENTRY_SIZE); 1605 got_offset, CONFIG_GOT_ENTRY_SIZE);
1607 1606
1608 got_needed = 1; 1607 got_needed = 1;
@@ -1610,13 +1609,13 @@ static void arch_create_got(struct obj_file *f)
1610#endif 1609#endif
1611#if defined(CONFIG_USE_PLT_ENTRIES) 1610#if defined(CONFIG_USE_PLT_ENTRIES)
1612 if (plt_allocate) { 1611 if (plt_allocate) {
1613#if defined(CONFIG_USE_PLT_LIST) 1612#if defined(CONFIG_USE_PLT_LIST)
1614 plt_offset += arch_list_add( 1613 plt_offset += arch_list_add(
1615 rel, &intsym->pltent, 1614 rel, &intsym->pltent,
1616 plt_offset, CONFIG_PLT_ENTRY_SIZE); 1615 plt_offset, CONFIG_PLT_ENTRY_SIZE);
1617#else 1616#else
1618 plt_offset += arch_single_init( 1617 plt_offset += arch_single_init(
1619 rel, &intsym->pltent, 1618 rel, &intsym->pltent,
1620 plt_offset, CONFIG_PLT_ENTRY_SIZE); 1619 plt_offset, CONFIG_PLT_ENTRY_SIZE);
1621#endif 1620#endif
1622 plt_needed = 1; 1621 plt_needed = 1;
@@ -1954,7 +1953,7 @@ static struct obj_section *obj_create_alloced_section_first(struct obj_file *f,
1954static void *obj_extend_section(struct obj_section *sec, unsigned long more) 1953static void *obj_extend_section(struct obj_section *sec, unsigned long more)
1955{ 1954{
1956 unsigned long oldsize = sec->header.sh_size; 1955 unsigned long oldsize = sec->header.sh_size;
1957 if (more) { 1956 if (more) {
1958 sec->contents = xrealloc(sec->contents, sec->header.sh_size += more); 1957 sec->contents = xrealloc(sec->contents, sec->header.sh_size += more);
1959 } 1958 }
1960 return sec->contents + oldsize; 1959 return sec->contents + oldsize;
@@ -2363,7 +2362,7 @@ old_init_module(const char *m_name, struct obj_file *f,
2363 struct obj_symbol *sym; 2362 struct obj_symbol *sym;
2364 for (sym = f->symtab[i]; sym; sym = sym->next) 2363 for (sym = f->symtab[i]; sym; sym = sym->next)
2365 if (ELFW(ST_BIND) (sym->info) != STB_LOCAL 2364 if (ELFW(ST_BIND) (sym->info) != STB_LOCAL
2366 && sym->secidx <= SHN_HIRESERVE) 2365 && sym->secidx <= SHN_HIRESERVE)
2367 { 2366 {
2368 sym->ksymidx = nsyms++; 2367 sym->ksymidx = nsyms++;
2369 strsize += strlen(sym->name) + 1; 2368 strsize += strlen(sym->name) + 1;
@@ -2977,7 +2976,7 @@ new_init_module(const char *m_name, struct obj_file *f,
2977 tgt_long m_addr; 2976 tgt_long m_addr;
2978 2977
2979 sec = obj_find_section(f, ".this"); 2978 sec = obj_find_section(f, ".this");
2980 if (!sec || !sec->contents) { 2979 if (!sec || !sec->contents) {
2981 bb_perror_msg_and_die("corrupt module %s?",m_name); 2980 bb_perror_msg_and_die("corrupt module %s?",m_name);
2982 } 2981 }
2983 module = (struct new_module *) sec->contents; 2982 module = (struct new_module *) sec->contents;
@@ -3499,7 +3498,7 @@ static struct obj_file *obj_load(FILE * fp, int loadprogbits)
3499 sec->contents = NULL; 3498 sec->contents = NULL;
3500 break; 3499 break;
3501 } 3500 }
3502#endif 3501#endif
3503 case SHT_SYMTAB: 3502 case SHT_SYMTAB:
3504 case SHT_STRTAB: 3503 case SHT_STRTAB:
3505 case SHT_RELM: 3504 case SHT_RELM:
@@ -3726,7 +3725,7 @@ static int obj_gpl_license(struct obj_file *f, const char **license)
3726#define TAINT_UNSAFE_SMP (1<<2) 3725#define TAINT_UNSAFE_SMP (1<<2)
3727#define TAINT_URL "http://www.tux.org/lkml/#export-tainted" 3726#define TAINT_URL "http://www.tux.org/lkml/#export-tainted"
3728 3727
3729static void set_tainted(struct obj_file *f, int fd, char *m_name, 3728static void set_tainted(struct obj_file *f, int fd, char *m_name,
3730 int kernel_has_tainted, int taint, const char *text1, const char *text2) 3729 int kernel_has_tainted, int taint, const char *text1, const char *text2)
3731{ 3730{
3732 char buf[80]; 3731 char buf[80];
@@ -3819,7 +3818,7 @@ get_module_version(struct obj_file *f, char str[STRVERSIONLEN])
3819 * start of some sections. this info is used by ksymoops to do better 3818 * start of some sections. this info is used by ksymoops to do better
3820 * debugging. 3819 * debugging.
3821 */ 3820 */
3822static void 3821static void
3823add_ksymoops_symbols(struct obj_file *f, const char *filename, 3822add_ksymoops_symbols(struct obj_file *f, const char *filename,
3824 const char *m_name) 3823 const char *m_name)
3825{ 3824{
@@ -4059,7 +4058,7 @@ extern int insmod_main( int argc, char **argv)
4059#ifdef CONFIG_FEATURE_INSMOD_LOAD_MAP 4058#ifdef CONFIG_FEATURE_INSMOD_LOAD_MAP
4060 while ((opt = getopt(argc, argv, "fkqsvxmLo:")) > 0) 4059 while ((opt = getopt(argc, argv, "fkqsvxmLo:")) > 0)
4061#else 4060#else
4062 while ((opt = getopt(argc, argv, "fkqsvxLo:")) > 0) 4061 while ((opt = getopt(argc, argv, "fkqsvxLo:")) > 0)
4063#endif 4062#endif
4064 { 4063 {
4065 switch (opt) { 4064 switch (opt) {
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 1b914e720..7bf314afe 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini lsmod implementation for busybox 3 * Mini lsmod implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Modified by Alcove, Julien Gaulmin <julien.gaulmin@alcove.fr> and 7 * Modified by Alcove, Julien Gaulmin <julien.gaulmin@alcove.fr> and
8 * Nicolas Ferre <nicolas.ferre@alcove.fr> to support pre 2.1 kernels 8 * Nicolas Ferre <nicolas.ferre@alcove.fr> to support pre 2.1 kernels
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index 0cebb6e67..cc9742c0a 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini rmmod implementation for busybox 3 * Mini rmmod implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -46,10 +46,10 @@ extern int rmmod_main(int argc, char **argv)
46 switch (n) { 46 switch (n) {
47 case 'w': // --wait 47 case 'w': // --wait
48 flags &= ~O_NONBLOCK; 48 flags &= ~O_NONBLOCK;
49 break; 49 break;
50 case 'f': // --force 50 case 'f': // --force
51 flags |= O_TRUNC; 51 flags |= O_TRUNC;
52 break; 52 break;
53 case 'a': 53 case 'a':
54 /* Unload _all_ unused modules via NULL delete_module() call */ 54 /* Unload _all_ unused modules via NULL delete_module() call */
55 /* until the number of modules does not change */ 55 /* until the number of modules does not change */
diff --git a/networking/Config.in b/networking/Config.in
index d2916e7cd..a7cef41bf 100644
--- a/networking/Config.in
+++ b/networking/Config.in
@@ -63,7 +63,7 @@ config CONFIG_FEATURE_HTTPD_AUTH_MD5
63 default n 63 default n
64 depends on CONFIG_FEATURE_HTTPD_BASIC_AUTH 64 depends on CONFIG_FEATURE_HTTPD_BASIC_AUTH
65 help 65 help
66 Enables basic per url authentication from /etc/httpd.conf 66 Enables basic per url authentication from /etc/httpd.conf
67 using md5 passwords. 67 using md5 passwords.
68 68
69 69
@@ -187,7 +187,7 @@ config CONFIG_IFUPDOWN
187config CONFIG_FEATURE_IFUPDOWN_IP 187config CONFIG_FEATURE_IFUPDOWN_IP
188 bool " Use ip applet" 188 bool " Use ip applet"
189 default n 189 default n
190 depends on CONFIG_IFUPDOWN 190 depends on CONFIG_IFUPDOWN
191 help 191 help
192 Use the iproute "ip" command to implement "ifup" and "ifdown", rather 192 Use the iproute "ip" command to implement "ifup" and "ifdown", rather
193 than the default of using the older 'ifconfig' and 'route' utilities. 193 than the default of using the older 'ifconfig' and 'route' utilities.
@@ -213,11 +213,11 @@ config CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN
213 select CONFIG_IFCONFIG 213 select CONFIG_IFCONFIG
214 select CONFIG_ROUTE 214 select CONFIG_ROUTE
215 help 215 help
216 Use the busybox iproute "ifconfig" and "route" applets to 216 Use the busybox iproute "ifconfig" and "route" applets to
217 implement the "ifup" and "ifdown" utilities. 217 implement the "ifup" and "ifdown" utilities.
218 218
219 If leave this disabled, you must install the full-blown ifconfig 219 If leave this disabled, you must install the full-blown ifconfig
220 and route utilities, or the "ifup" and "ifdown" applets will not 220 and route utilities, or the "ifup" and "ifdown" applets will not
221 work. 221 work.
222 222
223config CONFIG_FEATURE_IFUPDOWN_IPV4 223config CONFIG_FEATURE_IFUPDOWN_IPV4
@@ -339,7 +339,7 @@ if !(CONFIG_IP && CONFIG_IPROUTE)
339 default y 339 default y
340 depends on CONFIG_IP 340 depends on CONFIG_IP
341 help 341 help
342 Add support for routing table management to "ip". 342 Add support for routing table management to "ip".
343endif 343endif
344 344
345if CONFIG_IP && CONFIG_IPTUNNEL 345if CONFIG_IP && CONFIG_IPTUNNEL
diff --git a/networking/Makefile b/networking/Makefile
index 022f29e46..456c433fd 100644
--- a/networking/Makefile
+++ b/networking/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/networking/Makefile.in b/networking/Makefile.in
index 7748d066b..31de77fea 100644
--- a/networking/Makefile.in
+++ b/networking/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 17ee8a536..814253b53 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -1,7 +1,7 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * ftpget 3 * ftpget
4 * 4 *
5 * Mini implementation of FTP to retrieve a remote file. 5 * Mini implementation of FTP to retrieve a remote file.
6 * 6 *
7 * Copyright (C) 2002 Jeff Angielski, The PTR Group <jeff@theptrgroup.com> 7 * Copyright (C) 2002 Jeff Angielski, The PTR Group <jeff@theptrgroup.com>
@@ -131,7 +131,7 @@ static FILE *ftp_login(ftp_host_info_t *server)
131} 131}
132 132
133#ifdef CONFIG_FTPGET 133#ifdef CONFIG_FTPGET
134static int ftp_recieve(ftp_host_info_t *server, FILE *control_stream, 134static int ftp_recieve(ftp_host_info_t *server, FILE *control_stream,
135 const char *local_path, char *server_path) 135 const char *local_path, char *server_path)
136{ 136{
137 char buf[512]; 137 char buf[512];
@@ -203,13 +203,13 @@ static int ftp_recieve(ftp_host_info_t *server, FILE *control_stream,
203 bb_error_msg_and_die("ftp error: %s", buf + 4); 203 bb_error_msg_and_die("ftp error: %s", buf + 4);
204 } 204 }
205 ftpcmd("QUIT", NULL, control_stream, buf); 205 ftpcmd("QUIT", NULL, control_stream, buf);
206 206
207 return(EXIT_SUCCESS); 207 return(EXIT_SUCCESS);
208} 208}
209#endif 209#endif
210 210
211#ifdef CONFIG_FTPPUT 211#ifdef CONFIG_FTPPUT
212static int ftp_send(ftp_host_info_t *server, FILE *control_stream, 212static int ftp_send(ftp_host_info_t *server, FILE *control_stream,
213 const char *server_path, char *local_path) 213 const char *server_path, char *local_path)
214{ 214{
215 struct stat sbuf; 215 struct stat sbuf;
@@ -329,8 +329,8 @@ int ftpgetput_main(int argc, char **argv)
329 server->password = "busybox@"; 329 server->password = "busybox@";
330 verbose_flag = 0; 330 verbose_flag = 0;
331 331
332 /* 332 /*
333 * Decipher the command line 333 * Decipher the command line
334 */ 334 */
335 bb_applet_long_options = ftpgetput_long_options; 335 bb_applet_long_options = ftpgetput_long_options;
336 opt = bb_getopt_ulflags(argc, argv, "cvu:p:P:", &server->user, &server->password, &port); 336 opt = bb_getopt_ulflags(argc, argv, "cvu:p:P:", &server->user, &server->password, &port);
diff --git a/networking/httpd.c b/networking/httpd.c
index f2fd2b38d..aad30a1a1 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -44,7 +44,7 @@
44 * for page display. 44 * for page display.
45 * 45 *
46 * httpd.conf has the following format: 46 * httpd.conf has the following format:
47 * 47 *
48 * A:172.20. # Allow address from 172.20.0.0/16 48 * A:172.20. # Allow address from 172.20.0.0/16
49 * A:10.0.0.0/25 # Allow any address from 10.0.0.0-10.0.0.127 49 * A:10.0.0.0/25 # Allow any address from 10.0.0.0-10.0.0.127
50 * A:10.0.0.0/255.255.255.128 # Allow any address that previous set 50 * A:10.0.0.0/255.255.255.128 # Allow any address that previous set
@@ -54,13 +54,13 @@
54 * /adm:admin:setup # Require user admin, pwd setup on urls starting with /adm/ 54 * /adm:admin:setup # Require user admin, pwd setup on urls starting with /adm/
55 * /adm:toor:PaSsWd # or user toor, pwd PaSsWd on urls starting with /adm/ 55 * /adm:toor:PaSsWd # or user toor, pwd PaSsWd on urls starting with /adm/
56 * .au:audio/basic # additional mime type for audio.au files 56 * .au:audio/basic # additional mime type for audio.au files
57 * 57 *
58 * A/D may be as a/d or allow/deny - first char case unsensitive 58 * A/D may be as a/d or allow/deny - first char case unsensitive
59 * Deny IP rules take precedence over allow rules. 59 * Deny IP rules take precedence over allow rules.
60 * 60 *
61 * 61 *
62 * The Deny/Allow IP logic: 62 * The Deny/Allow IP logic:
63 * 63 *
64 * - Default is to allow all. No addresses are denied unless 64 * - Default is to allow all. No addresses are denied unless
65 * denied with a D: rule. 65 * denied with a D: rule.
66 * - Order of Deny/Allow rules is significant 66 * - Order of Deny/Allow rules is significant
@@ -68,19 +68,19 @@
68 * - If a deny all rule (D:*) is used it acts as a catch-all for unmatched 68 * - If a deny all rule (D:*) is used it acts as a catch-all for unmatched
69 * addresses. 69 * addresses.
70 * - Specification of Allow all (A:*) is a no-op 70 * - Specification of Allow all (A:*) is a no-op
71 * 71 *
72 * Example: 72 * Example:
73 * 1. Allow only specified addresses 73 * 1. Allow only specified addresses
74 * A:172.20 # Allow any address that begins with 172.20. 74 * A:172.20 # Allow any address that begins with 172.20.
75 * A:10.10. # Allow any address that begins with 10.10. 75 * A:10.10. # Allow any address that begins with 10.10.
76 * A:127.0.0.1 # Allow local loopback connections 76 * A:127.0.0.1 # Allow local loopback connections
77 * D:* # Deny from other IP connections 77 * D:* # Deny from other IP connections
78 * 78 *
79 * 2. Only deny specified addresses 79 * 2. Only deny specified addresses
80 * D:1.2.3. # deny from 1.2.3.0 - 1.2.3.255 80 * D:1.2.3. # deny from 1.2.3.0 - 1.2.3.255
81 * D:2.3.4. # deny from 2.3.4.0 - 2.3.4.255 81 * D:2.3.4. # deny from 2.3.4.0 - 2.3.4.255
82 * A:* # (optional line added for clarity) 82 * A:* # (optional line added for clarity)
83 * 83 *
84 * If a sub directory contains a config file it is parsed and merged with 84 * If a sub directory contains a config file it is parsed and merged with
85 * any existing settings as if it was appended to the original configuration. 85 * any existing settings as if it was appended to the original configuration.
86 * 86 *
@@ -91,11 +91,11 @@
91 * subdir http request, any merge is discarded when the process exits. As a 91 * subdir http request, any merge is discarded when the process exits. As a
92 * result, the subdir settings only have a lifetime of a single request. 92 * result, the subdir settings only have a lifetime of a single request.
93 * 93 *
94 * 94 *
95 * If -c is not set, an attempt will be made to open the default 95 * If -c is not set, an attempt will be made to open the default
96 * root configuration file. If -c is set and the file is not found, the 96 * root configuration file. If -c is set and the file is not found, the
97 * server exits with an error. 97 * server exits with an error.
98 * 98 *
99*/ 99*/
100 100
101 101
@@ -447,7 +447,7 @@ static void free_config_lines(Htaccess **pprev)
447 > $Function: parse_conf() 447 > $Function: parse_conf()
448 * 448 *
449 * $Description: parse configuration file into in-memory linked list. 449 * $Description: parse configuration file into in-memory linked list.
450 * 450 *
451 * The first non-white character is examined to determine if the config line 451 * The first non-white character is examined to determine if the config line
452 * is one of the following: 452 * is one of the following:
453 * .ext:mime/type # new mime type not compiled into httpd 453 * .ext:mime/type # new mime type not compiled into httpd
@@ -464,7 +464,7 @@ static void free_config_lines(Htaccess **pprev)
464 * checks. 464 * checks.
465 * (int) flag . . . . . . the source of the parse request. 465 * (int) flag . . . . . . the source of the parse request.
466 * 466 *
467 * $Return: (None) 467 * $Return: (None)
468 * 468 *
469 ****************************************************************************/ 469 ****************************************************************************/
470static void parse_conf(const char *path, int flag) 470static void parse_conf(const char *path, int flag)
@@ -1726,7 +1726,7 @@ FORBIDDEN: /* protect listing /cgi-bin */
1726 /* Properly wait for remote to closed */ 1726 /* Properly wait for remote to closed */
1727 FD_ZERO (&s_fd) ; 1727 FD_ZERO (&s_fd) ;
1728 FD_SET (a_c_w, &s_fd) ; 1728 FD_SET (a_c_w, &s_fd) ;
1729 1729
1730 do { 1730 do {
1731 tv.tv_sec = 2 ; 1731 tv.tv_sec = 2 ;
1732 tv.tv_usec = 0 ; 1732 tv.tv_usec = 0 ;
diff --git a/networking/ifconfig.c b/networking/ifconfig.c
index 341998d8d..b884ef7c3 100644
--- a/networking/ifconfig.c
+++ b/networking/ifconfig.c
@@ -6,7 +6,7 @@
6 * Bjorn Wesen, Axis Communications AB 6 * Bjorn Wesen, Axis Communications AB
7 * 7 *
8 * 8 *
9 * Authors of the original ifconfig was: 9 * Authors of the original ifconfig was:
10 * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> 10 * Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
11 * 11 *
12 * This program is free software; you can redistribute it 12 * This program is free software; you can redistribute it
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: ifconfig.c,v 1.28 2004/03/06 22:11:44 andersen Exp $ 18 * $Id: ifconfig.c,v 1.29 2004/03/15 08:28:48 andersen Exp $
19 * 19 *
20 */ 20 */
21 21
@@ -510,7 +510,7 @@ int ifconfig_main(int argc, char **argv)
510 * a - at the end, since it's deleted already! - Roman 510 * a - at the end, since it's deleted already! - Roman
511 * 511 *
512 * Should really use regex.h here, not sure though how well 512 * Should really use regex.h here, not sure though how well
513 * it'll go with the cross-platform support etc. 513 * it'll go with the cross-platform support etc.
514 */ 514 */
515 char *ptr; 515 char *ptr;
516 short int found_colon = 0; 516 short int found_colon = 0;
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index bd0021ab4..c34e2b955 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * ifupdown for busybox 3 * ifupdown for busybox
4 * Copyright (c) 2002 Glenn McGrath <bug1@optushome.com.au> 4 * Copyright (c) 2002 Glenn McGrath <bug1@optushome.com.au>
5 * Copyright (c) 2003 Erik Andersen <andersen@codepoet.org> 5 * Copyright (c) 2003-2004 Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Based on ifupdown v 0.6.4 by Anthony Towns 7 * Based on ifupdown v 0.6.4 by Anthony Towns
8 * Copyright (c) 1999 Anthony Towns <aj@azure.humbug.org.au> 8 * Copyright (c) 1999 Anthony Towns <aj@azure.humbug.org.au>
@@ -56,7 +56,7 @@
56#if 0 56#if 0
57#define debug_noise(fmt, args...) printf(fmt, ## args) 57#define debug_noise(fmt, args...) printf(fmt, ## args)
58#else 58#else
59#define debug_noise(fmt, args...) 59#define debug_noise(fmt, args...)
60#endif 60#endif
61 61
62/* Forward declaration */ 62/* Forward declaration */
@@ -72,7 +72,7 @@ extern llist_t *llist_add_to_end(llist_t *list_head, char *data)
72 new_item = xmalloc(sizeof(llist_t)); 72 new_item = xmalloc(sizeof(llist_t));
73 new_item->data = data; 73 new_item->data = data;
74 new_item->link = NULL; 74 new_item->link = NULL;
75 75
76 prev = NULL; 76 prev = NULL;
77 tmp = list_head; 77 tmp = list_head;
78 while(tmp) { 78 while(tmp) {
@@ -80,7 +80,7 @@ extern llist_t *llist_add_to_end(llist_t *list_head, char *data)
80 tmp = tmp->link; 80 tmp = tmp->link;
81 } 81 }
82 if (prev) { 82 if (prev) {
83 prev->link = new_item; 83 prev->link = new_item;
84 } else { 84 } else {
85 list_head = new_item; 85 list_head = new_item;
86 } 86 }
@@ -123,7 +123,7 @@ struct variable_t
123 char *value; 123 char *value;
124}; 124};
125 125
126struct interface_defn_t 126struct interface_defn_t
127{ 127{
128 struct interface_defn_t *prev; 128 struct interface_defn_t *prev;
129 struct interface_defn_t *next; 129 struct interface_defn_t *next;
@@ -598,7 +598,7 @@ static int wvdial_down(struct interface_defn_t *ifd, execfn *exec)
598 "-p /var/run/wvdial.%iface% -s 2", ifd, exec)); 598 "-p /var/run/wvdial.%iface% -s 2", ifd, exec));
599} 599}
600 600
601static struct method_t methods[] = 601static struct method_t methods[] =
602{ 602{
603 { "wvdial", wvdial_up, wvdial_down, }, 603 { "wvdial", wvdial_up, wvdial_down, },
604 { "ppp", ppp_up, ppp_down, }, 604 { "ppp", ppp_up, ppp_down, },
@@ -608,7 +608,7 @@ static struct method_t methods[] =
608 { "loopback", loopback_up, loopback_down, }, 608 { "loopback", loopback_up, loopback_down, },
609}; 609};
610 610
611struct address_family_t addr_inet = 611struct address_family_t addr_inet =
612{ 612{
613 "inet", 613 "inet",
614 sizeof(methods) / sizeof(struct method_t), 614 sizeof(methods) / sizeof(struct method_t),
@@ -885,7 +885,7 @@ static struct interfaces_file_t *read_interfaces(char *filename)
885 perror(filename); 885 perror(filename);
886 return NULL; 886 return NULL;
887 } 887 }
888 debug_noise("\t%s=%s\n", currif->option[currif->n_options].name, 888 debug_noise("\t%s=%s\n", currif->option[currif->n_options].name,
889 currif->option[currif->n_options].value); 889 currif->option[currif->n_options].value);
890 currif->n_options++; 890 currif->n_options++;
891 break; 891 break;
@@ -1031,7 +1031,7 @@ static int execute_all(struct interface_defn_t *ifd, execfn *exec, const char *o
1031 } 1031 }
1032 } 1032 }
1033 } 1033 }
1034 1034
1035 bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt); 1035 bb_xasprintf(&buf, "run-parts /etc/network/if-%s.d", opt);
1036 (*exec)(buf); 1036 (*exec)(buf);
1037 1037
@@ -1211,7 +1211,7 @@ extern int ifupdown_main(int argc, char **argv)
1211#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING 1211#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
1212 while ((i = getopt(argc, argv, "i:hvnamf")) != -1) 1212 while ((i = getopt(argc, argv, "i:hvnamf")) != -1)
1213#else 1213#else
1214 while ((i = getopt(argc, argv, "i:hvnaf")) != -1) 1214 while ((i = getopt(argc, argv, "i:hvnaf")) != -1)
1215#endif 1215#endif
1216 { 1216 {
1217 switch (i) { 1217 switch (i) {
@@ -1249,7 +1249,7 @@ extern int ifupdown_main(int argc, char **argv)
1249 if (!do_all) { 1249 if (!do_all) {
1250 bb_show_usage(); 1250 bb_show_usage();
1251 } 1251 }
1252 } 1252 }
1253 1253
1254 debug_noise("reading %s file:\n", interfaces); 1254 debug_noise("reading %s file:\n", interfaces);
1255 defn = read_interfaces(interfaces); 1255 defn = read_interfaces(interfaces);
@@ -1297,8 +1297,8 @@ extern int ifupdown_main(int argc, char **argv)
1297 list = list->link; 1297 list = list->link;
1298 } 1298 }
1299 target_list = defn->autointerfaces; 1299 target_list = defn->autointerfaces;
1300#endif 1300#endif
1301 } 1301 }
1302 } else { 1302 } else {
1303 target_list = llist_add_to_end(target_list, argv[optind]); 1303 target_list = llist_add_to_end(target_list, argv[optind]);
1304 } 1304 }
@@ -1413,7 +1413,7 @@ extern int ifupdown_main(int argc, char **argv)
1413 } else { 1413 } else {
1414 iface_state->data = NULL; 1414 iface_state->data = NULL;
1415 iface_state->link = NULL; 1415 iface_state->link = NULL;
1416 } 1416 }
1417 } 1417 }
1418 } 1418 }
1419 } 1419 }
diff --git a/networking/libiproute/Makefile b/networking/libiproute/Makefile
index c1f18be7b..0dc7191d3 100644
--- a/networking/libiproute/Makefile
+++ b/networking/libiproute/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/networking/libiproute/Makefile.in b/networking/libiproute/Makefile.in
index f39eeb3ee..d6f95048c 100644
--- a/networking/libiproute/Makefile.in
+++ b/networking/libiproute/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index 1f3d73933..a76df48e0 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -47,7 +47,7 @@ void ip_parse_common_args(int *argcp, char ***argvp)
47 if (matches(opt, "-family") == 0) { 47 if (matches(opt, "-family") == 0) {
48 argc--; 48 argc--;
49 argv++; 49 argv++;
50 if (! argv[1]) 50 if (! argv[1])
51 bb_show_usage(); 51 bb_show_usage();
52 if (strcmp(argv[1], "inet") == 0) 52 if (strcmp(argv[1], "inet") == 0)
53 preferred_family = AF_INET; 53 preferred_family = AF_INET;
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 44e871ee5..7e0c75785 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -91,7 +91,7 @@ static void print_queuelen(char *name)
91 91
92 memset(&ifr, 0, sizeof(ifr)); 92 memset(&ifr, 0, sizeof(ifr));
93 strcpy(ifr.ifr_name, name); 93 strcpy(ifr.ifr_name, name);
94 if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) { 94 if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) {
95 perror("SIOCGIFXQLEN"); 95 perror("SIOCGIFXQLEN");
96 close(s); 96 close(s);
97 return; 97 return;
@@ -166,7 +166,7 @@ static int print_linkinfo(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg
166#endif 166#endif
167 if (filter.showqueue) 167 if (filter.showqueue)
168 print_queuelen((char*)RTA_DATA(tb[IFLA_IFNAME])); 168 print_queuelen((char*)RTA_DATA(tb[IFLA_IFNAME]));
169 169
170 if (!filter.family || filter.family == AF_PACKET) { 170 if (!filter.family || filter.family == AF_PACKET) {
171 SPRINT_BUF(b1); 171 SPRINT_BUF(b1);
172 fprintf(fp, "%s", _SL_); 172 fprintf(fp, "%s", _SL_);
@@ -378,7 +378,7 @@ static int print_selected_addrinfo(int ifindex, struct nlmsg_list *ainfo, FILE *
378 if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifa))) 378 if (n->nlmsg_len < NLMSG_LENGTH(sizeof(ifa)))
379 return -1; 379 return -1;
380 380
381 if (ifa->ifa_index != ifindex || 381 if (ifa->ifa_index != ifindex ||
382 (filter.family && filter.family != ifa->ifa_family)) 382 (filter.family && filter.family != ifa->ifa_family))
383 continue; 383 continue;
384 384
@@ -564,7 +564,7 @@ extern int ipaddr_list_or_flush(int argc, char **argv, int flush)
564 struct nlmsghdr *n = &a->h; 564 struct nlmsghdr *n = &a->h;
565 struct ifaddrmsg *ifa = NLMSG_DATA(n); 565 struct ifaddrmsg *ifa = NLMSG_DATA(n);
566 566
567 if (ifa->ifa_index != ifi->ifi_index || 567 if (ifa->ifa_index != ifi->ifi_index ||
568 (filter.family && filter.family != ifa->ifa_family)) 568 (filter.family && filter.family != ifa->ifa_family))
569 continue; 569 continue;
570 if ((filter.scope^ifa->ifa_scope)&filter.scopemask) 570 if ((filter.scope^ifa->ifa_scope)&filter.scopemask)
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c
index daab6938d..44b546d59 100644
--- a/networking/libiproute/iplink.c
+++ b/networking/libiproute/iplink.c
@@ -128,8 +128,8 @@ static int set_qlen(char *dev, int qlen)
128 return -1; 128 return -1;
129 129
130 memset(&ifr, 0, sizeof(ifr)); 130 memset(&ifr, 0, sizeof(ifr));
131 strcpy(ifr.ifr_name, dev); 131 strcpy(ifr.ifr_name, dev);
132 ifr.ifr_qlen = qlen; 132 ifr.ifr_qlen = qlen;
133 if (ioctl(s, SIOCSIFTXQLEN, &ifr) < 0) { 133 if (ioctl(s, SIOCSIFTXQLEN, &ifr) < 0) {
134 perror("SIOCSIFXQLEN"); 134 perror("SIOCSIFXQLEN");
135 close(s); 135 close(s);
@@ -137,7 +137,7 @@ static int set_qlen(char *dev, int qlen)
137 } 137 }
138 close(s); 138 close(s);
139 139
140 return 0; 140 return 0;
141} 141}
142 142
143static int set_mtu(char *dev, int mtu) 143static int set_mtu(char *dev, int mtu)
@@ -150,8 +150,8 @@ static int set_mtu(char *dev, int mtu)
150 return -1; 150 return -1;
151 151
152 memset(&ifr, 0, sizeof(ifr)); 152 memset(&ifr, 0, sizeof(ifr));
153 strcpy(ifr.ifr_name, dev); 153 strcpy(ifr.ifr_name, dev);
154 ifr.ifr_mtu = mtu; 154 ifr.ifr_mtu = mtu;
155 if (ioctl(s, SIOCSIFMTU, &ifr) < 0) { 155 if (ioctl(s, SIOCSIFMTU, &ifr) < 0) {
156 perror("SIOCSIFMTU"); 156 perror("SIOCSIFMTU");
157 close(s); 157 close(s);
@@ -159,7 +159,7 @@ static int set_mtu(char *dev, int mtu)
159 } 159 }
160 close(s); 160 close(s);
161 161
162 return 0; 162 return 0;
163} 163}
164 164
165static int get_address(char *dev, int *htype) 165static int get_address(char *dev, int *htype)
@@ -170,7 +170,7 @@ static int get_address(char *dev, int *htype)
170 int s; 170 int s;
171 171
172 s = socket(PF_PACKET, SOCK_DGRAM, 0); 172 s = socket(PF_PACKET, SOCK_DGRAM, 0);
173 if (s < 0) { 173 if (s < 0) {
174 perror("socket(PF_PACKET)"); 174 perror("socket(PF_PACKET)");
175 return -1; 175 return -1;
176 } 176 }
@@ -218,7 +218,7 @@ static int parse_address(char *dev, int hatype, int halen, char *lla, struct ifr
218 bb_error_msg("Wrong address (%s) length: expected %d bytes", lla, halen); 218 bb_error_msg("Wrong address (%s) length: expected %d bytes", lla, halen);
219 return -1; 219 return -1;
220 } 220 }
221 return 0; 221 return 0;
222} 222}
223 223
224static int set_address(struct ifreq *ifr, int brd) 224static int set_address(struct ifreq *ifr, int brd)
@@ -234,7 +234,7 @@ static int set_address(struct ifreq *ifr, int brd)
234 return -1; 234 return -1;
235 } 235 }
236 close(s); 236 close(s);
237 return 0; 237 return 0;
238} 238}
239 239
240 240
@@ -311,7 +311,7 @@ static int do_set(int argc, char **argv)
311 } 311 }
312 if (newbrd) { 312 if (newbrd) {
313 if (parse_address(dev, htype, halen, newbrd, &ifr1) < 0) 313 if (parse_address(dev, htype, halen, newbrd, &ifr1) < 0)
314 return -1; 314 return -1;
315 } 315 }
316 } 316 }
317 317
@@ -320,18 +320,18 @@ static int do_set(int argc, char **argv)
320 return -1; 320 return -1;
321 dev = newname; 321 dev = newname;
322 } 322 }
323 if (qlen != -1) { 323 if (qlen != -1) {
324 if (set_qlen(dev, qlen) < 0) 324 if (set_qlen(dev, qlen) < 0)
325 return -1; 325 return -1;
326 } 326 }
327 if (mtu != -1) { 327 if (mtu != -1) {
328 if (set_mtu(dev, mtu) < 0) 328 if (set_mtu(dev, mtu) < 0)
329 return -1; 329 return -1;
330 } 330 }
331 if (newaddr || newbrd) { 331 if (newaddr || newbrd) {
332 if (newbrd) { 332 if (newbrd) {
333 if (set_address(&ifr1, 1) < 0) 333 if (set_address(&ifr1, 1) < 0)
334 return -1; 334 return -1;
335 } 335 }
336 if (newaddr) { 336 if (newaddr) {
337 if (set_address(&ifr0, 0) < 0) 337 if (set_address(&ifr0, 0) < 0)
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c
index 0fdf7987e..7adbfcd61 100644
--- a/networking/libiproute/iproute.c
+++ b/networking/libiproute/iproute.c
@@ -76,7 +76,7 @@ static int print_route(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
76 inet_prefix src; 76 inet_prefix src;
77 int host_len = -1; 77 int host_len = -1;
78 SPRINT_BUF(b1); 78 SPRINT_BUF(b1);
79 79
80 80
81 if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) { 81 if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) {
82 fprintf(stderr, "Not a route: %08x %08x %08x\n", 82 fprintf(stderr, "Not a route: %08x %08x %08x\n",
@@ -228,7 +228,7 @@ static int print_route(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
228 fprintf(fp, "from 0/%u ", r->rtm_src_len); 228 fprintf(fp, "from 0/%u ", r->rtm_src_len);
229 } 229 }
230 if (tb[RTA_GATEWAY] && filter.rvia.bitlen != host_len) { 230 if (tb[RTA_GATEWAY] && filter.rvia.bitlen != host_len) {
231 fprintf(fp, "via %s ", 231 fprintf(fp, "via %s ",
232 format_host(r->rtm_family, 232 format_host(r->rtm_family,
233 RTA_PAYLOAD(tb[RTA_GATEWAY]), 233 RTA_PAYLOAD(tb[RTA_GATEWAY]),
234 RTA_DATA(tb[RTA_GATEWAY]), 234 RTA_DATA(tb[RTA_GATEWAY]),
@@ -242,7 +242,7 @@ static int print_route(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
242 /* Do not use format_host(). It is our local addr 242 /* Do not use format_host(). It is our local addr
243 and symbolic name will not be useful. 243 and symbolic name will not be useful.
244 */ 244 */
245 fprintf(fp, " src %s ", 245 fprintf(fp, " src %s ",
246 rt_addr_n2a(r->rtm_family, 246 rt_addr_n2a(r->rtm_family,
247 RTA_PAYLOAD(tb[RTA_PREFSRC]), 247 RTA_PAYLOAD(tb[RTA_PREFSRC]),
248 RTA_DATA(tb[RTA_PREFSRC]), 248 RTA_DATA(tb[RTA_PREFSRC]),
@@ -665,7 +665,7 @@ static int iproute_get(int argc, char **argv)
665 req.r.rtm_src_len = 0; 665 req.r.rtm_src_len = 0;
666 req.r.rtm_dst_len = 0; 666 req.r.rtm_dst_len = 0;
667 req.r.rtm_tos = 0; 667 req.r.rtm_tos = 0;
668 668
669 while (argc > 0) { 669 while (argc > 0) {
670 switch (compare_string_array(options, *argv)) { 670 switch (compare_string_array(options, *argv)) {
671 case 0: /* from */ 671 case 0: /* from */
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index eae5bb091..3f5d05ae9 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -354,7 +354,7 @@ static int do_add(int cmd, int argc, char **argv)
354 return do_add_ioctl(cmd, "gre0", &p); 354 return do_add_ioctl(cmd, "gre0", &p);
355 case IPPROTO_IPV6: 355 case IPPROTO_IPV6:
356 return do_add_ioctl(cmd, "sit0", &p); 356 return do_add_ioctl(cmd, "sit0", &p);
357 default: 357 default:
358 bb_error_msg("cannot determine tunnel mode (ipip, gre or sit)"); 358 bb_error_msg("cannot determine tunnel mode (ipip, gre or sit)");
359 return -1; 359 return -1;
360 } 360 }
@@ -375,7 +375,7 @@ int do_del(int argc, char **argv)
375 return do_del_ioctl("gre0", &p); 375 return do_del_ioctl("gre0", &p);
376 case IPPROTO_IPV6: 376 case IPPROTO_IPV6:
377 return do_del_ioctl("sit0", &p); 377 return do_del_ioctl("sit0", &p);
378 default: 378 default:
379 return do_del_ioctl(p.name, &p); 379 return do_del_ioctl(p.name, &p);
380 } 380 }
381 return -1; 381 return -1;
@@ -506,7 +506,7 @@ static int do_show(int argc, char **argv)
506 return -1; 506 return -1;
507 507
508 switch (p.iph.protocol) { 508 switch (p.iph.protocol) {
509 case IPPROTO_IPIP: 509 case IPPROTO_IPIP:
510 err = do_get_ioctl(p.name[0] ? p.name : "tunl0", &p); 510 err = do_get_ioctl(p.name[0] ? p.name : "tunl0", &p);
511 break; 511 break;
512 case IPPROTO_GRE: 512 case IPPROTO_GRE:
diff --git a/networking/libiproute/libnetlink.c b/networking/libiproute/libnetlink.c
index 9390e56fb..861daef86 100644
--- a/networking/libiproute/libnetlink.c
+++ b/networking/libiproute/libnetlink.c
@@ -317,7 +317,7 @@ int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
317 } 317 }
318} 318}
319 319
320int rtnl_listen(struct rtnl_handle *rtnl, 320int rtnl_listen(struct rtnl_handle *rtnl,
321 int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *), 321 int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
322 void *jarg) 322 void *jarg)
323{ 323{
@@ -389,7 +389,7 @@ int rtnl_listen(struct rtnl_handle *rtnl,
389 } 389 }
390} 390}
391 391
392int rtnl_from_file(FILE *rtnl, 392int rtnl_from_file(FILE *rtnl,
393 int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *), 393 int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
394 void *jarg) 394 void *jarg)
395{ 395{
diff --git a/networking/libiproute/linux/pkt_sched.h b/networking/libiproute/linux/pkt_sched.h
index e174588f5..70cbabc26 100644
--- a/networking/libiproute/linux/pkt_sched.h
+++ b/networking/libiproute/linux/pkt_sched.h
@@ -221,19 +221,19 @@ enum
221#define TCA_SET_OFF TCA_GRED_PARMS 221#define TCA_SET_OFF TCA_GRED_PARMS
222struct tc_gred_qopt 222struct tc_gred_qopt
223{ 223{
224 __u32 limit; /* HARD maximal queue length (bytes) 224 __u32 limit; /* HARD maximal queue length (bytes)
225*/ 225*/
226 __u32 qth_min; /* Min average length threshold (bytes) 226 __u32 qth_min; /* Min average length threshold (bytes)
227*/ 227*/
228 __u32 qth_max; /* Max average length threshold (bytes) 228 __u32 qth_max; /* Max average length threshold (bytes)
229*/ 229*/
230 __u32 DP; /* upto 2^32 DPs */ 230 __u32 DP; /* upto 2^32 DPs */
231 __u32 backlog; 231 __u32 backlog;
232 __u32 qave; 232 __u32 qave;
233 __u32 forced; 233 __u32 forced;
234 __u32 early; 234 __u32 early;
235 __u32 other; 235 __u32 other;
236 __u32 pdrop; 236 __u32 pdrop;
237 237
238 unsigned char Wlog; /* log(W) */ 238 unsigned char Wlog; /* log(W) */
239 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */ 239 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
@@ -294,7 +294,7 @@ struct tc_htb_xstats
294 __u32 lends; 294 __u32 lends;
295 __u32 borrows; 295 __u32 borrows;
296 __u32 giants; /* too big packets (rate will not be accurate) */ 296 __u32 giants; /* too big packets (rate will not be accurate) */
297 __u32 injects; /* how many times leaf used injected bw */ 297 __u32 injects; /* how many times leaf used injected bw */
298 __u32 tokens; 298 __u32 tokens;
299 __u32 ctokens; 299 __u32 ctokens;
300}; 300};
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c
index 45afdb82a..9b5260b32 100644
--- a/networking/libiproute/ll_proto.c
+++ b/networking/libiproute/ll_proto.c
@@ -26,62 +26,62 @@ static struct {
26 char *name; 26 char *name;
27} llproto_names[] = { 27} llproto_names[] = {
28__PF(LOOP,loop) 28__PF(LOOP,loop)
29__PF(PUP,pup) 29__PF(PUP,pup)
30#ifdef ETH_P_PUPAT 30#ifdef ETH_P_PUPAT
31__PF(PUPAT,pupat) 31__PF(PUPAT,pupat)
32#endif 32#endif
33__PF(IP,ip) 33__PF(IP,ip)
34__PF(X25,x25) 34__PF(X25,x25)
35__PF(ARP,arp) 35__PF(ARP,arp)
36__PF(BPQ,bpq) 36__PF(BPQ,bpq)
37#ifdef ETH_P_IEEEPUP 37#ifdef ETH_P_IEEEPUP
38__PF(IEEEPUP,ieeepup) 38__PF(IEEEPUP,ieeepup)
39#endif 39#endif
40#ifdef ETH_P_IEEEPUPAT 40#ifdef ETH_P_IEEEPUPAT
41__PF(IEEEPUPAT,ieeepupat) 41__PF(IEEEPUPAT,ieeepupat)
42#endif 42#endif
43__PF(DEC,dec) 43__PF(DEC,dec)
44__PF(DNA_DL,dna_dl) 44__PF(DNA_DL,dna_dl)
45__PF(DNA_RC,dna_rc) 45__PF(DNA_RC,dna_rc)
46__PF(DNA_RT,dna_rt) 46__PF(DNA_RT,dna_rt)
47__PF(LAT,lat) 47__PF(LAT,lat)
48__PF(DIAG,diag) 48__PF(DIAG,diag)
49__PF(CUST,cust) 49__PF(CUST,cust)
50__PF(SCA,sca) 50__PF(SCA,sca)
51__PF(RARP,rarp) 51__PF(RARP,rarp)
52__PF(ATALK,atalk) 52__PF(ATALK,atalk)
53__PF(AARP,aarp) 53__PF(AARP,aarp)
54__PF(IPX,ipx) 54__PF(IPX,ipx)
55__PF(IPV6,ipv6) 55__PF(IPV6,ipv6)
56#ifdef ETH_P_PPP_DISC 56#ifdef ETH_P_PPP_DISC
57__PF(PPP_DISC,ppp_disc) 57__PF(PPP_DISC,ppp_disc)
58#endif 58#endif
59#ifdef ETH_P_PPP_SES 59#ifdef ETH_P_PPP_SES
60__PF(PPP_SES,ppp_ses) 60__PF(PPP_SES,ppp_ses)
61#endif 61#endif
62#ifdef ETH_P_ATMMPOA 62#ifdef ETH_P_ATMMPOA
63__PF(ATMMPOA,atmmpoa) 63__PF(ATMMPOA,atmmpoa)
64#endif 64#endif
65#ifdef ETH_P_ATMFATE 65#ifdef ETH_P_ATMFATE
66__PF(ATMFATE,atmfate) 66__PF(ATMFATE,atmfate)
67#endif 67#endif
68 68
69__PF(802_3,802_3) 69__PF(802_3,802_3)
70__PF(AX25,ax25) 70__PF(AX25,ax25)
71__PF(ALL,all) 71__PF(ALL,all)
72__PF(802_2,802_2) 72__PF(802_2,802_2)
73__PF(SNAP,snap) 73__PF(SNAP,snap)
74__PF(DDCMP,ddcmp) 74__PF(DDCMP,ddcmp)
75__PF(WAN_PPP,wan_ppp) 75__PF(WAN_PPP,wan_ppp)
76__PF(PPP_MP,ppp_mp) 76__PF(PPP_MP,ppp_mp)
77__PF(LOCALTALK,localtalk) 77__PF(LOCALTALK,localtalk)
78__PF(PPPTALK,ppptalk) 78__PF(PPPTALK,ppptalk)
79__PF(TR_802_2,tr_802_2) 79__PF(TR_802_2,tr_802_2)
80__PF(MOBITEX,mobitex) 80__PF(MOBITEX,mobitex)
81__PF(CONTROL,control) 81__PF(CONTROL,control)
82__PF(IRDA,irda) 82__PF(IRDA,irda)
83#ifdef ETH_P_ECONET 83#ifdef ETH_P_ECONET
84__PF(ECONET,econet) 84__PF(ECONET,econet)
85#endif 85#endif
86 86
87{ 0x8100, "802.1Q" }, 87{ 0x8100, "802.1Q" },
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h
index b51e07be4..e79e177b9 100644
--- a/networking/libiproute/utils.h
+++ b/networking/libiproute/utils.h
@@ -43,7 +43,7 @@ typedef struct
43#define AF_DECnet 12 43#define AF_DECnet 12
44#endif 44#endif
45 45
46struct dn_naddr 46struct dn_naddr
47{ 47{
48 unsigned short a_len; 48 unsigned short a_len;
49 unsigned char a_addr[DN_MAXADDL]; 49 unsigned char a_addr[DN_MAXADDL];
diff --git a/networking/nc.c b/networking/nc.c
index ecb4a007b..9a353c94f 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -4,7 +4,7 @@
4 4
5 0.0.1 6K It works. 5 0.0.1 6K It works.
6 0.0.2 5K Smaller and you can also check the exit condition if you wish. 6 0.0.2 5K Smaller and you can also check the exit condition if you wish.
7 0.0.3 Uses select() 7 0.0.3 Uses select()
8 8
9 19980918 Busy Boxed! Dave Cinege 9 19980918 Busy Boxed! Dave Cinege
10 19990512 Uses Select. Charles P. Wright 10 19990512 Uses Select. Charles P. Wright
@@ -47,7 +47,7 @@ int nc_main(int argc, char **argv)
47 int do_listen = 0, lport = 0, delay = 0, tmpfd, opt, sfd, x; 47 int do_listen = 0, lport = 0, delay = 0, tmpfd, opt, sfd, x;
48 char buf[BUFSIZ]; 48 char buf[BUFSIZ];
49#ifdef GAPING_SECURITY_HOLE 49#ifdef GAPING_SECURITY_HOLE
50 char * pr00gie = NULL; 50 char * pr00gie = NULL;
51#endif 51#endif
52 52
53 struct sockaddr_in address; 53 struct sockaddr_in address;
@@ -79,7 +79,7 @@ int nc_main(int argc, char **argv)
79#ifdef GAPING_SECURITY_HOLE 79#ifdef GAPING_SECURITY_HOLE
80 if (pr00gie) { 80 if (pr00gie) {
81 /* won't need stdin */ 81 /* won't need stdin */
82 close (fileno(stdin)); 82 close (fileno(stdin));
83 } 83 }
84#endif /* GAPING_SECURITY_HOLE */ 84#endif /* GAPING_SECURITY_HOLE */
85 85
diff --git a/networking/netstat.c b/networking/netstat.c
index 17a58876c..bc1ed057b 100644
--- a/networking/netstat.c
+++ b/networking/netstat.c
@@ -210,7 +210,7 @@ static void tcp_do_one(int lnr, const char *line)
210 snprint_ip_port(local_addr, sizeof(local_addr), 210 snprint_ip_port(local_addr, sizeof(local_addr),
211 (struct sockaddr *) &localaddr, local_port, 211 (struct sockaddr *) &localaddr, local_port,
212 "tcp", flags&NETSTAT_NUMERIC); 212 "tcp", flags&NETSTAT_NUMERIC);
213 213
214 snprint_ip_port(rem_addr, sizeof(rem_addr), 214 snprint_ip_port(rem_addr, sizeof(rem_addr),
215 (struct sockaddr *) &remaddr, rem_port, 215 (struct sockaddr *) &remaddr, rem_port,
216 "tcp", flags&NETSTAT_NUMERIC); 216 "tcp", flags&NETSTAT_NUMERIC);
@@ -305,7 +305,7 @@ static void udp_do_one(int lnr, const char *line)
305 snprint_ip_port(local_addr, sizeof(local_addr), 305 snprint_ip_port(local_addr, sizeof(local_addr),
306 (struct sockaddr *) &localaddr, local_port, 306 (struct sockaddr *) &localaddr, local_port,
307 "udp", flags&NETSTAT_NUMERIC); 307 "udp", flags&NETSTAT_NUMERIC);
308 308
309 snprint_ip_port(rem_addr, sizeof(rem_addr), 309 snprint_ip_port(rem_addr, sizeof(rem_addr),
310 (struct sockaddr *) &remaddr, rem_port, 310 (struct sockaddr *) &remaddr, rem_port,
311 "udp", flags&NETSTAT_NUMERIC); 311 "udp", flags&NETSTAT_NUMERIC);
@@ -387,7 +387,7 @@ static void raw_do_one(int lnr, const char *line)
387 snprint_ip_port(local_addr, sizeof(local_addr), 387 snprint_ip_port(local_addr, sizeof(local_addr),
388 (struct sockaddr *) &localaddr, local_port, 388 (struct sockaddr *) &localaddr, local_port,
389 "raw", flags&NETSTAT_NUMERIC); 389 "raw", flags&NETSTAT_NUMERIC);
390 390
391 snprint_ip_port(rem_addr, sizeof(rem_addr), 391 snprint_ip_port(rem_addr, sizeof(rem_addr),
392 (struct sockaddr *) &remaddr, rem_port, 392 (struct sockaddr *) &remaddr, rem_port,
393 "raw", flags&NETSTAT_NUMERIC); 393 "raw", flags&NETSTAT_NUMERIC);
@@ -558,7 +558,7 @@ int netstat_main(int argc, char **argv)
558{ 558{
559 int opt; 559 int opt;
560 int new_flags=0; 560 int new_flags=0;
561 int showroute = 0, extended = 0; 561 int showroute = 0, extended = 0;
562#ifdef CONFIG_FEATURE_IPV6 562#ifdef CONFIG_FEATURE_IPV6
563 int inet=1; 563 int inet=1;
564 int inet6=1; 564 int inet6=1;
@@ -600,14 +600,14 @@ int netstat_main(int argc, char **argv)
600 bb_show_usage(); 600 bb_show_usage();
601 } 601 }
602 if ( showroute ) { 602 if ( showroute ) {
603#ifdef CONFIG_ROUTE 603#ifdef CONFIG_ROUTE
604 displayroutes ( flags & NETSTAT_NUMERIC, !extended ); 604 displayroutes ( flags & NETSTAT_NUMERIC, !extended );
605 return 0; 605 return 0;
606#else 606#else
607 bb_error_msg_and_die( "-r (display routing table) is not compiled in." ); 607 bb_error_msg_and_die( "-r (display routing table) is not compiled in." );
608#endif 608#endif
609 } 609 }
610 610
611 if (new_flags) { 611 if (new_flags) {
612 flags &= ~(NETSTAT_TCP|NETSTAT_UDP|NETSTAT_RAW|NETSTAT_UNIX); 612 flags &= ~(NETSTAT_TCP|NETSTAT_UDP|NETSTAT_RAW|NETSTAT_UNIX);
613 flags |= new_flags; 613 flags |= new_flags;
diff --git a/networking/nslookup.c b/networking/nslookup.c
index 329510630..bb691d687 100644
--- a/networking/nslookup.c
+++ b/networking/nslookup.c
@@ -187,7 +187,7 @@ int nslookup_main(int argc, char **argv)
187 187
188 if (argc < 2 || *argv[1]=='-' || argc > 3) 188 if (argc < 2 || *argv[1]=='-' || argc > 3)
189 bb_show_usage(); 189 bb_show_usage();
190 else if(argc == 3) 190 else if(argc == 3)
191 set_default_dns(argv[2]); 191 set_default_dns(argv[2]);
192 192
193 server_print(); 193 server_print();
@@ -200,4 +200,4 @@ int nslookup_main(int argc, char **argv)
200 return EXIT_SUCCESS; 200 return EXIT_SUCCESS;
201} 201}
202 202
203/* $Id: nslookup.c,v 1.31 2004/01/30 22:40:05 andersen Exp $ */ 203/* $Id: nslookup.c,v 1.32 2004/03/15 08:28:48 andersen Exp $ */
diff --git a/networking/ping.c b/networking/ping.c
index a38f356d6..50f3930ff 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping.c,v 1.55 2003/07/22 08:56:51 andersen Exp $ 3 * $Id: ping.c,v 1.56 2004/03/15 08:28:48 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -27,7 +27,7 @@
27 * 27 *
28 * This code is derived from software contributed to Berkeley by 28 * This code is derived from software contributed to Berkeley by
29 * Mike Muuss. 29 * Mike Muuss.
30 * 30 *
31 * Original copyright notice is retained at the end of this file. 31 * Original copyright notice is retained at the end of this file.
32 */ 32 */
33 33
@@ -329,7 +329,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from)
329 if (dupflag) 329 if (dupflag)
330 printf(" (DUP!)"); 330 printf(" (DUP!)");
331 printf("\n"); 331 printf("\n");
332 } else 332 } else
333 if (icmppkt->icmp_type != ICMP_ECHO) 333 if (icmppkt->icmp_type != ICMP_ECHO)
334 bb_error_msg("Warning: Got ICMP %d (%s)", 334 bb_error_msg("Warning: Got ICMP %d (%s)",
335 icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type)); 335 icmppkt->icmp_type, icmp_type_name (icmppkt->icmp_type));
@@ -451,8 +451,8 @@ extern int ping_main(int argc, char **argv)
451 * notice, this list of conditions and the following disclaimer in the 451 * notice, this list of conditions and the following disclaimer in the
452 * documentation and/or other materials provided with the distribution. 452 * documentation and/or other materials provided with the distribution.
453 * 453 *
454 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 454 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
455 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 455 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
456 * 456 *
457 * 4. Neither the name of the University nor the names of its contributors 457 * 4. Neither the name of the University nor the names of its contributors
458 * may be used to endorse or promote products derived from this software 458 * may be used to endorse or promote products derived from this software
diff --git a/networking/ping6.c b/networking/ping6.c
index d9d0dd343..72867f346 100644
--- a/networking/ping6.c
+++ b/networking/ping6.c
@@ -1,6 +1,6 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * $Id: ping6.c,v 1.5 2003/05/22 07:10:22 andersen Exp $ 3 * $Id: ping6.c,v 1.6 2004/03/15 08:28:48 andersen Exp $
4 * Mini ping implementation for busybox 4 * Mini ping implementation for busybox
5 * 5 *
6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> 6 * Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@ -27,7 +27,7 @@
27 * 27 *
28 * This code is derived from software contributed to Berkeley by 28 * This code is derived from software contributed to Berkeley by
29 * Mike Muuss. 29 * Mike Muuss.
30 * 30 *
31 * Original copyright notice is retained at the end of this file. 31 * Original copyright notice is retained at the end of this file.
32 * 32 *
33 * This version is an adaptation of ping.c from busybox. 33 * This version is an adaptation of ping.c from busybox.
@@ -162,7 +162,7 @@ static unsigned long tmin = ULONG_MAX, tmax, tsum;
162static char rcvd_tbl[MAX_DUP_CHK / 8]; 162static char rcvd_tbl[MAX_DUP_CHK / 8];
163 163
164# ifdef CONFIG_FEATURE_FANCY_PING 164# ifdef CONFIG_FEATURE_FANCY_PING
165extern 165extern
166# endif 166# endif
167 struct hostent *hostent; 167 struct hostent *hostent;
168 168
@@ -302,12 +302,12 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit
302 inet_ntop(AF_INET6, (struct in_addr6 *) &pingaddr.sin6_addr, 302 inet_ntop(AF_INET6, (struct in_addr6 *) &pingaddr.sin6_addr,
303 buf, sizeof(buf)), 303 buf, sizeof(buf)),
304 icmppkt->icmp6_seq); 304 icmppkt->icmp6_seq);
305 printf(" ttl=%d time=%lu.%lu ms", hoplimit, 305 printf(" ttl=%d time=%lu.%lu ms", hoplimit,
306 triptime / 10, triptime % 10); 306 triptime / 10, triptime % 10);
307 if (dupflag) 307 if (dupflag)
308 printf(" (DUP!)"); 308 printf(" (DUP!)");
309 printf("\n"); 309 printf("\n");
310 } else 310 } else
311 if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST) 311 if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST)
312 bb_error_msg("Warning: Got ICMP %d (%s)", 312 bb_error_msg("Warning: Got ICMP %d (%s)",
313 icmppkt->icmp6_type, icmp6_type_name (icmppkt->icmp6_type)); 313 icmppkt->icmp6_type, icmp6_type_name (icmppkt->icmp6_type));
@@ -494,8 +494,8 @@ extern int ping6_main(int argc, char **argv)
494 * notice, this list of conditions and the following disclaimer in the 494 * notice, this list of conditions and the following disclaimer in the
495 * documentation and/or other materials provided with the distribution. 495 * documentation and/or other materials provided with the distribution.
496 * 496 *
497 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 497 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
498 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 498 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
499 * 499 *
500 * 4. Neither the name of the University nor the names of its contributors 500 * 4. Neither the name of the University nor the names of its contributors
501 * may be used to endorse or promote products derived from this software 501 * may be used to endorse or promote products derived from this software
diff --git a/networking/route.c b/networking/route.c
index 111900d33..9e7a01034 100644
--- a/networking/route.c
+++ b/networking/route.c
@@ -15,7 +15,7 @@
15 * Foundation; either version 2 of the License, or (at 15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version. 16 * your option) any later version.
17 * 17 *
18 * $Id: route.c,v 1.24 2004/03/10 07:42:38 mjn3 Exp $ 18 * $Id: route.c,v 1.25 2004/03/15 08:28:49 andersen Exp $
19 * 19 *
20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru> 20 * displayroute() code added by Vladimir N. Oleynik <dzo@simtreas.ru>
21 * adjustments by Larry Doolittle <LRDoolittle@lbl.gov> 21 * adjustments by Larry Doolittle <LRDoolittle@lbl.gov>
@@ -107,7 +107,7 @@ static const char tbl_hash_net_host[] =
107#define KW_IPVx_DYN 042 107#define KW_IPVx_DYN 042
108#define KW_IPVx_REINSTATE 043 108#define KW_IPVx_REINSTATE 043
109 109
110static const char tbl_ipvx[] = 110static const char tbl_ipvx[] =
111 /* 020 is the "takes an arg" bit */ 111 /* 020 is the "takes an arg" bit */
112#if HAVE_NEW_ADDRT 112#if HAVE_NEW_ADDRT
113 "\011\020metric\0" 113 "\011\020metric\0"
@@ -206,7 +206,7 @@ static void INET_setroute(int action, char **args)
206 while (*args) { 206 while (*args) {
207 int k = kw_lookup(tbl_ipvx, &args); 207 int k = kw_lookup(tbl_ipvx, &args);
208 const char *args_m1 = args[-1]; 208 const char *args_m1 = args[-1];
209 209
210 if (k & KW_IPVx_FLAG_ONLY) { 210 if (k & KW_IPVx_FLAG_ONLY) {
211 rt.rt_flags |= flags_ipvx[k & 3]; 211 rt.rt_flags |= flags_ipvx[k & 3];
212 continue; 212 continue;
@@ -666,7 +666,7 @@ int route_main(int argc, char **argv)
666 p[0][0] = '#'; 666 p[0][0] = '#';
667 } 667 }
668 } 668 }
669 } 669 }
670 670
671 opt = bb_getopt_ulflags(argc, argv, "A:ne", &family); 671 opt = bb_getopt_ulflags(argc, argv, "A:ne", &family);
672 672
diff --git a/networking/telnet.c b/networking/telnet.c
index 574fe8dab..6c5f3d15b 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -54,7 +54,7 @@ static const int DOTRACE = 1;
54#include <arpa/inet.h> /* for inet_ntoa()... */ 54#include <arpa/inet.h> /* for inet_ntoa()... */
55#define TRACE(x, y) do { if (x) printf y; } while (0) 55#define TRACE(x, y) do { if (x) printf y; } while (0)
56#else 56#else
57#define TRACE(x, y) 57#define TRACE(x, y)
58#endif 58#endif
59 59
60#if 0 60#if 0
@@ -99,8 +99,8 @@ static struct Globalvars {
99 /* buffer to handle telnet negotiations */ 99 /* buffer to handle telnet negotiations */
100 char iacbuf[IACBUFSIZE]; 100 char iacbuf[IACBUFSIZE];
101 short iaclen; /* could even use byte */ 101 short iaclen; /* could even use byte */
102 struct termios termios_def; 102 struct termios termios_def;
103 struct termios termios_raw; 103 struct termios termios_raw;
104} G; 104} G;
105 105
106#define xUSE_GLOBALVAR_PTR /* xUSE... -> don't use :D (makes smaller code) */ 106#define xUSE_GLOBALVAR_PTR /* xUSE... -> don't use :D (makes smaller code) */
@@ -143,7 +143,7 @@ static void doexit(int ev)
143{ 143{
144 cookmode(); 144 cookmode();
145 exit(ev); 145 exit(ev);
146} 146}
147 147
148static void conescape(void) 148static void conescape(void)
149{ 149{
@@ -190,10 +190,10 @@ static void conescape(void)
190 190
191 if (G.gotsig) 191 if (G.gotsig)
192 cookmode(); 192 cookmode();
193 193
194 rrturn: 194 rrturn:
195 G.gotsig = 0; 195 G.gotsig = 0;
196 196
197} 197}
198static void handlenetoutput(int len) 198static void handlenetoutput(int len)
199{ 199{
@@ -442,7 +442,7 @@ static void will_charmode(void)
442 G.charmode = CHM_TRY; 442 G.charmode = CHM_TRY;
443 G.telflags |= (UF_ECHO | UF_SGA); 443 G.telflags |= (UF_ECHO | UF_SGA);
444 setConMode(); 444 setConMode();
445 445
446 putiac2(DO, TELOPT_ECHO); 446 putiac2(DO, TELOPT_ECHO);
447 putiac2(DO, TELOPT_SGA); 447 putiac2(DO, TELOPT_SGA);
448 iacflush(); 448 iacflush();
@@ -472,7 +472,7 @@ static inline void to_echo(void)
472 /* if server requests ECHO, don't agree */ 472 /* if server requests ECHO, don't agree */
473 if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; } 473 if (G.telwish == DO) { putiac2(WONT, TELOPT_ECHO); return; }
474 else if (G.telwish == DONT) return; 474 else if (G.telwish == DONT) return;
475 475
476 if (G.telflags & UF_ECHO) 476 if (G.telflags & UF_ECHO)
477 { 477 {
478 if (G.telwish == WILL) 478 if (G.telwish == WILL)
@@ -506,7 +506,7 @@ static inline void to_sga(void)
506 else 506 else
507 if (G.telwish == WONT) 507 if (G.telwish == WONT)
508 return; 508 return;
509 509
510 if ((G.telflags ^= UF_SGA) & UF_SGA) /* toggle */ 510 if ((G.telflags ^= UF_SGA) & UF_SGA) /* toggle */
511 putiac2(DO, TELOPT_SGA); 511 putiac2(DO, TELOPT_SGA);
512 else 512 else
@@ -545,11 +545,11 @@ static inline void to_new_environ(void)
545 545
546#ifdef CONFIG_FEATURE_AUTOWIDTH 546#ifdef CONFIG_FEATURE_AUTOWIDTH
547static inline void to_naws(void) 547static inline void to_naws(void)
548{ 548{
549 /* Tell server we will do NAWS */ 549 /* Tell server we will do NAWS */
550 putiac2(WILL, TELOPT_NAWS); 550 putiac2(WILL, TELOPT_NAWS);
551 return; 551 return;
552} 552}
553#endif 553#endif
554 554
555static void telopt(byte c) 555static void telopt(byte c)
@@ -617,7 +617,7 @@ static void fgotsig(int sig)
617static void rawmode(void) 617static void rawmode(void)
618{ 618{
619 tcsetattr(0, TCSADRAIN, &G.termios_raw); 619 tcsetattr(0, TCSADRAIN, &G.termios_raw);
620} 620}
621 621
622static void cookmode(void) 622static void cookmode(void)
623{ 623{
@@ -630,10 +630,10 @@ extern int telnet_main(int argc, char** argv)
630 struct sockaddr_in s_in; 630 struct sockaddr_in s_in;
631#ifdef USE_POLL 631#ifdef USE_POLL
632 struct pollfd ufds[2]; 632 struct pollfd ufds[2];
633#else 633#else
634 fd_set readfds; 634 fd_set readfds;
635 int maxfd; 635 int maxfd;
636#endif 636#endif
637 637
638#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN 638#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
639 int opt; 639 int opt;
@@ -651,13 +651,13 @@ extern int telnet_main(int argc, char** argv)
651 651
652 if (tcgetattr(0, &G.termios_def) < 0) 652 if (tcgetattr(0, &G.termios_def) < 0)
653 exit(1); 653 exit(1);
654 654
655 G.termios_raw = G.termios_def; 655 G.termios_raw = G.termios_def;
656 cfmakeraw(&G.termios_raw); 656 cfmakeraw(&G.termios_raw);
657 657
658 if (argc < 2) 658 if (argc < 2)
659 bb_show_usage(); 659 bb_show_usage();
660 660
661#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN 661#ifdef CONFIG_FEATURE_TELNET_AUTOLOGIN
662 autologin = NULL; 662 autologin = NULL;
663 while ((opt = getopt(argc, argv, "al:")) != EOF) { 663 while ((opt = getopt(argc, argv, "al:")) != EOF) {
@@ -685,7 +685,7 @@ extern int telnet_main(int argc, char** argv)
685 bb_lookup_host(&s_in, argv[1]); 685 bb_lookup_host(&s_in, argv[1]);
686 s_in.sin_port = bb_lookup_port((argc == 3) ? argv[2] : "telnet", "tcp", 23); 686 s_in.sin_port = bb_lookup_port((argc == 3) ? argv[2] : "telnet", "tcp", 23);
687#endif 687#endif
688 688
689 G.netfd = xconnect(&s_in); 689 G.netfd = xconnect(&s_in);
690 690
691 setsockopt(G.netfd, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof one); 691 setsockopt(G.netfd, SOL_SOCKET, SO_KEEPALIVE, &one, sizeof one);
@@ -695,22 +695,22 @@ extern int telnet_main(int argc, char** argv)
695#ifdef USE_POLL 695#ifdef USE_POLL
696 ufds[0].fd = 0; ufds[1].fd = G.netfd; 696 ufds[0].fd = 0; ufds[1].fd = G.netfd;
697 ufds[0].events = ufds[1].events = POLLIN; 697 ufds[0].events = ufds[1].events = POLLIN;
698#else 698#else
699 FD_ZERO(&readfds); 699 FD_ZERO(&readfds);
700 FD_SET(0, &readfds); 700 FD_SET(0, &readfds);
701 FD_SET(G.netfd, &readfds); 701 FD_SET(G.netfd, &readfds);
702 maxfd = G.netfd + 1; 702 maxfd = G.netfd + 1;
703#endif 703#endif
704 704
705 while (1) 705 while (1)
706 { 706 {
707#ifndef USE_POLL 707#ifndef USE_POLL
708 fd_set rfds = readfds; 708 fd_set rfds = readfds;
709 709
710 switch (select(maxfd, &rfds, NULL, NULL, NULL)) 710 switch (select(maxfd, &rfds, NULL, NULL, NULL))
711#else 711#else
712 switch (poll(ufds, 2, -1)) 712 switch (poll(ufds, 2, -1))
713#endif 713#endif
714 { 714 {
715 case 0: 715 case 0:
716 /* timeout */ 716 /* timeout */
@@ -725,9 +725,9 @@ extern int telnet_main(int argc, char** argv)
725 725
726#ifdef USE_POLL 726#ifdef USE_POLL
727 if (ufds[0].revents) /* well, should check POLLIN, but ... */ 727 if (ufds[0].revents) /* well, should check POLLIN, but ... */
728#else 728#else
729 if (FD_ISSET(0, &rfds)) 729 if (FD_ISSET(0, &rfds))
730#endif 730#endif
731 { 731 {
732 len = read(0, G.buf, DATABUFSIZE); 732 len = read(0, G.buf, DATABUFSIZE);
733 733
@@ -735,15 +735,15 @@ extern int telnet_main(int argc, char** argv)
735 doexit(0); 735 doexit(0);
736 736
737 TRACE(0, ("Read con: %d\n", len)); 737 TRACE(0, ("Read con: %d\n", len));
738 738
739 handlenetoutput(len); 739 handlenetoutput(len);
740 } 740 }
741 741
742#ifdef USE_POLL 742#ifdef USE_POLL
743 if (ufds[1].revents) /* well, should check POLLIN, but ... */ 743 if (ufds[1].revents) /* well, should check POLLIN, but ... */
744#else 744#else
745 if (FD_ISSET(G.netfd, &rfds)) 745 if (FD_ISSET(G.netfd, &rfds))
746#endif 746#endif
747 { 747 {
748 len = read(G.netfd, G.buf, DATABUFSIZE); 748 len = read(G.netfd, G.buf, DATABUFSIZE);
749 749
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 3051cfa1e..efb2988b3 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -1,4 +1,4 @@
1/* $Id: telnetd.c,v 1.10 2004/02/22 09:45:57 bug1 Exp $ 1/* $Id: telnetd.c,v 1.11 2004/03/15 08:28:53 andersen Exp $
2 * 2 *
3 * Simple telnet server 3 * Simple telnet server
4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) 4 * Bjorn Wesen, Axis Communications AB (bjornw@axis.com)
@@ -49,7 +49,7 @@
49 49
50#define BUFSIZE 4000 50#define BUFSIZE 4000
51 51
52static const char *loginpath 52static const char *loginpath
53#ifdef CONFIG_LOGIN 53#ifdef CONFIG_LOGIN
54 = "/bin/login"; 54 = "/bin/login";
55#else 55#else
@@ -540,7 +540,7 @@ telnetd_main(int argc, char **argv)
540#ifndef CONFIG_FEATURE_TELNETD_INETD 540#ifndef CONFIG_FEATURE_TELNETD_INETD
541 struct tsession *next = ts->next; /* in case we free ts. */ 541 struct tsession *next = ts->next; /* in case we free ts. */
542#endif /* CONFIG_FEATURE_TELNETD_INETD */ 542#endif /* CONFIG_FEATURE_TELNETD_INETD */
543 543
544 if (ts->size1 && FD_ISSET(ts->ptyfd, &wrfdset)) { 544 if (ts->size1 && FD_ISSET(ts->ptyfd, &wrfdset)) {
545 int num_totty; 545 int num_totty;
546 char *ptr; 546 char *ptr;
diff --git a/networking/tftp.c b/networking/tftp.c
index 10aa63bb9..bd973d79a 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -76,15 +76,15 @@ const int tftp_cmd_put = 2;
76 76
77#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE 77#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
78 78
79static int tftp_blocksize_check(int blocksize, int bufsize) 79static int tftp_blocksize_check(int blocksize, int bufsize)
80{ 80{
81 /* Check if the blocksize is valid: 81 /* Check if the blocksize is valid:
82 * RFC2348 says between 8 and 65464, 82 * RFC2348 says between 8 and 65464,
83 * but our implementation makes it impossible 83 * but our implementation makes it impossible
84 * to use blocksizes smaller than 22 octets. 84 * to use blocksizes smaller than 22 octets.
85 */ 85 */
86 86
87 if ((bufsize && (blocksize > bufsize)) || 87 if ((bufsize && (blocksize > bufsize)) ||
88 (blocksize < 8) || (blocksize > 65464)) { 88 (blocksize < 8) || (blocksize > 65464)) {
89 bb_error_msg("bad blocksize"); 89 bb_error_msg("bad blocksize");
90 return 0; 90 return 0;
@@ -93,12 +93,12 @@ static int tftp_blocksize_check(int blocksize, int bufsize)
93 return blocksize; 93 return blocksize;
94} 94}
95 95
96static char *tftp_option_get(char *buf, int len, char *option) 96static char *tftp_option_get(char *buf, int len, char *option)
97{ 97{
98 int opt_val = 0; 98 int opt_val = 0;
99 int opt_found = 0; 99 int opt_found = 0;
100 int k; 100 int k;
101 101
102 while (len > 0) { 102 while (len > 0) {
103 103
104 /* Make sure the options are terminated correctly */ 104 /* Make sure the options are terminated correctly */
@@ -117,21 +117,21 @@ static char *tftp_option_get(char *buf, int len, char *option)
117 if (strcasecmp(buf, option) == 0) { 117 if (strcasecmp(buf, option) == 0) {
118 opt_found = 1; 118 opt_found = 1;
119 } 119 }
120 } 120 }
121 else { 121 else {
122 if (opt_found) { 122 if (opt_found) {
123 return buf; 123 return buf;
124 } 124 }
125 } 125 }
126 126
127 k++; 127 k++;
128 128
129 buf += k; 129 buf += k;
130 len -= k; 130 len -= k;
131 131
132 opt_val ^= 1; 132 opt_val ^= 1;
133 } 133 }
134 134
135 return NULL; 135 return NULL;
136} 136}
137 137
@@ -207,7 +207,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
207 207
208 if ((cmd_get && (opcode == TFTP_RRQ)) || 208 if ((cmd_get && (opcode == TFTP_RRQ)) ||
209 (cmd_put && (opcode == TFTP_WRQ))) { 209 (cmd_put && (opcode == TFTP_WRQ))) {
210 int too_long = 0; 210 int too_long = 0;
211 211
212 /* see if the filename fits into buf */ 212 /* see if the filename fits into buf */
213 /* and fill in packet */ 213 /* and fill in packet */
@@ -380,7 +380,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
380 if (buf[4] != '\0') { 380 if (buf[4] != '\0') {
381 msg = &buf[4]; 381 msg = &buf[4];
382 buf[tftp_bufsize - 1] = '\0'; 382 buf[tftp_bufsize - 1] = '\0';
383 } else if (tmp < (sizeof(tftp_bb_error_msg) 383 } else if (tmp < (sizeof(tftp_bb_error_msg)
384 / sizeof(char *))) { 384 / sizeof(char *))) {
385 385
386 msg = (char *) tftp_bb_error_msg[tmp]; 386 msg = (char *) tftp_bb_error_msg[tmp];
@@ -404,12 +404,12 @@ static inline int tftp(const int cmd, const struct hostent *host,
404 404
405 char *res; 405 char *res;
406 406
407 res = tftp_option_get(&buf[2], len-2, 407 res = tftp_option_get(&buf[2], len-2,
408 "blksize"); 408 "blksize");
409 409
410 if (res) { 410 if (res) {
411 int blksize = atoi(res); 411 int blksize = atoi(res);
412 412
413 if (tftp_blocksize_check(blksize, 413 if (tftp_blocksize_check(blksize,
414 tftp_bufsize - 4)) { 414 tftp_bufsize - 4)) {
415 415
@@ -443,7 +443,7 @@ static inline int tftp(const int cmd, const struct hostent *host,
443 if (cmd_get && (opcode == TFTP_DATA)) { 443 if (cmd_get && (opcode == TFTP_DATA)) {
444 444
445 if (tmp == block_nr) { 445 if (tmp == block_nr) {
446 446
447 len = write(localfd, &buf[4], len - 4); 447 len = write(localfd, &buf[4], len - 4);
448 448
449 if (len < 0) { 449 if (len < 0) {
@@ -506,13 +506,13 @@ int tftp_main(int argc, char **argv)
506#ifdef CONFIG_FEATURE_TFTP_GET 506#ifdef CONFIG_FEATURE_TFTP_GET
507#define GET "g" 507#define GET "g"
508#else 508#else
509#define GET 509#define GET
510#endif 510#endif
511 511
512#ifdef CONFIG_FEATURE_TFTP_PUT 512#ifdef CONFIG_FEATURE_TFTP_PUT
513#define PUT "p" 513#define PUT "p"
514#else 514#else
515#define PUT 515#define PUT
516#endif 516#endif
517 517
518 while ((opt = getopt(argc, argv, BS GET PUT "l:r:")) != -1) { 518 while ((opt = getopt(argc, argv, BS GET PUT "l:r:")) != -1) {
@@ -537,7 +537,7 @@ int tftp_main(int argc, char **argv)
537 flags = O_RDONLY; 537 flags = O_RDONLY;
538 break; 538 break;
539#endif 539#endif
540 case 'l': 540 case 'l':
541 localfile = bb_xstrdup(optarg); 541 localfile = bb_xstrdup(optarg);
542 break; 542 break;
543 case 'r': 543 case 'r':
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 5f8989fd1..44ffdf07e 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -75,7 +75,7 @@
75#include <netinet/ip.h> 75#include <netinet/ip.h>
76#include <netinet/ip_icmp.h> 76#include <netinet/ip_icmp.h>
77 77
78 78
79#define MAXPACKET 65535 /* max ip packet size */ 79#define MAXPACKET 65535 /* max ip packet size */
80#ifndef MAXHOSTNAMELEN 80#ifndef MAXHOSTNAMELEN
81#define MAXHOSTNAMELEN 64 81#define MAXHOSTNAMELEN 64
diff --git a/networking/udhcp/AUTHORS b/networking/udhcp/AUTHORS
index bb58de13e..f3f43364a 100644
--- a/networking/udhcp/AUTHORS
+++ b/networking/udhcp/AUTHORS
@@ -8,7 +8,6 @@ Chris Trew <christ@moreton.com.au>
8Other Credits: 8Other Credits:
9-------------- 9--------------
10Moreton Bay (http://www.moretonbay.com/) 10Moreton Bay (http://www.moretonbay.com/)
11Lineo (http://opensource.lineo.com)
12Vladimir Oleynik <dzo@simtrea.ru> Size optimizations 11Vladimir Oleynik <dzo@simtrea.ru> Size optimizations
13 12
14 13
diff --git a/networking/udhcp/ChangeLog b/networking/udhcp/ChangeLog
index f1aac060e..2feffc776 100644
--- a/networking/udhcp/ChangeLog
+++ b/networking/udhcp/ChangeLog
@@ -39,7 +39,7 @@
39 (Ted Lemon <Ted.Lemon@nominum.com>) 39 (Ted Lemon <Ted.Lemon@nominum.com>)
40+ Improved (hopefully) NAKing behavior (me) 40+ Improved (hopefully) NAKing behavior (me)
41+ Added -b option (Jouni Malinen) 41+ Added -b option (Jouni Malinen)
42+ Compute checksums correctly on big endian hosts 42+ Compute checksums correctly on big endian hosts
43 (Jouni Malinen <jkmaline@cc.hut.fi>) 43 (Jouni Malinen <jkmaline@cc.hut.fi>)
44 44
450.9.7 (020526) 450.9.7 (020526)
diff --git a/networking/udhcp/Makefile b/networking/udhcp/Makefile
index ee34d48ff..2b79d2293 100644
--- a/networking/udhcp/Makefile
+++ b/networking/udhcp/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/networking/udhcp/Makefile.in b/networking/udhcp/Makefile.in
index 4d3f27093..b48079429 100644
--- a/networking/udhcp/Makefile.in
+++ b/networking/udhcp/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/networking/udhcp/README b/networking/udhcp/README
index eddb24be7..dd992949a 100644
--- a/networking/udhcp/README
+++ b/networking/udhcp/README
@@ -10,30 +10,30 @@ compile time options
10------------------- 10-------------------
11 11
12The Makefile contains three of the compile time options: 12The Makefile contains three of the compile time options:
13 13
14 UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra 14 UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra
15 debugging output, compile with -g, and not fork to the background when 15 debugging output, compile with -g, and not fork to the background when
16 run. 16 run.
17 UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its 17 UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its
18 messages syslog, otherwise, it will attempt to log them to stdout. 18 messages syslog, otherwise, it will attempt to log them to stdout.
19 19
20 COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd, 20 COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd,
21 is created. If called as udhcpd, the dhcp server will be started. 21 is created. If called as udhcpd, the dhcp server will be started.
22 If called as udhcpc, the dhcp client will be started. 22 If called as udhcpc, the dhcp client will be started.
23 23
24dhcpd.h contains the other three compile time options: 24dhcpd.h contains the other three compile time options:
25 25
26 LEASE_TIME: The default lease time if not specified in the config 26 LEASE_TIME: The default lease time if not specified in the config
27 file. 27 file.
28 28
29 LEASES_FILE: The default file for storing leases. 29 LEASES_FILE: The default file for storing leases.
30 30
31 DHCPD_CONFIG_FILE: The defualt config file to use. 31 DHCPD_CONFIG_FILE: The defualt config file to use.
32 32
33options.c contains a set of dhcp options for the client: 33options.c contains a set of dhcp options for the client:
34 34
35 name[10]: The name of the option as it will appear in scripts 35 name[10]: The name of the option as it will appear in scripts
36 36
37 flags: The type of option, as well as if it will be requested 37 flags: The type of option, as well as if it will be requested
38 by the client (OPTION_REQ) 38 by the client (OPTION_REQ)
39 39
@@ -45,7 +45,7 @@ busybox drop-in
45udhcp is now a drop-in component for busybox (http://busybox.net). 45udhcp is now a drop-in component for busybox (http://busybox.net).
46To update busybox to the latest revision, simply do a: 46To update busybox to the latest revision, simply do a:
47 47
48cp *.[ch] README AUTHORS COPYING ChangeLog TODO \ 48cp *.[ch] README AUTHORS COPYING ChangeLog TODO \
49 <busybox_source>/networking/udhcp 49 <busybox_source>/networking/udhcp
50 50
51The only two files udhcp does not provide are config.in and 51The only two files udhcp does not provide are config.in and
diff --git a/networking/udhcp/README.udhcpc b/networking/udhcp/README.udhcpc
index 8aee9814b..d720a37cf 100644
--- a/networking/udhcp/README.udhcpc
+++ b/networking/udhcp/README.udhcpc
@@ -36,20 +36,20 @@ udhcp client scripts
36 36
37When an event occurs, udhcpc calls the action script. udhcpc never does 37When an event occurs, udhcpc calls the action script. udhcpc never does
38any configuration of the network interface itself, but instead relies on 38any configuration of the network interface itself, but instead relies on
39a set of scripts. The script by default is 39a set of scripts. The script by default is
40/usr/share/udhcpc/default.script but this can be changed via the command 40/usr/share/udhcpc/default.script but this can be changed via the command
41line arguments. The three possible arguments to the script are: 41line arguments. The three possible arguments to the script are:
42 42
43 deconfig: This argument is used when udhcpc starts, and 43 deconfig: This argument is used when udhcpc starts, and
44 when a leases is lost. The script must put the interface in an 44 when a leases is lost. The script must put the interface in an
45 up, but deconfigured state, ie: ifconfig $interface 0.0.0.0. 45 up, but deconfigured state, ie: ifconfig $interface 0.0.0.0.
46 46
47 bound: This argument is used when udhcpc moves from an 47 bound: This argument is used when udhcpc moves from an
48 unbound, to a bound state. All of the paramaters are set in 48 unbound, to a bound state. All of the paramaters are set in
49 enviromental variables, The script should configure the interface, 49 enviromental variables, The script should configure the interface,
50 and set any other relavent parameters (default gateway, dns server, 50 and set any other relavent parameters (default gateway, dns server,
51 etc). 51 etc).
52 52
53 renew: This argument is used when a DHCP lease is renewed. All of 53 renew: This argument is used when a DHCP lease is renewed. All of
54 the paramaters are set in enviromental variables. This argument is 54 the paramaters are set in enviromental variables. This argument is
55 used when the interface is already configured, so the IP address, 55 used when the interface is already configured, so the IP address,
@@ -133,7 +133,7 @@ compile time options
133options.c contains a set of dhcp options for the client: 133options.c contains a set of dhcp options for the client:
134 134
135 name[10]: The name of the option as it will appear in scripts 135 name[10]: The name of the option as it will appear in scripts
136 136
137 flags: The type of option, as well as if it will be requested 137 flags: The type of option, as well as if it will be requested
138 by the client (OPTION_REQ) 138 by the client (OPTION_REQ)
139 139
diff --git a/networking/udhcp/README.udhcpd b/networking/udhcp/README.udhcpd
index bc6137de3..169de78ec 100644
--- a/networking/udhcp/README.udhcpd
+++ b/networking/udhcp/README.udhcpd
@@ -14,7 +14,7 @@ udhcpd.leases
14 14
15The udhcpd.leases behavior is designed for an embedded system. The 15The udhcpd.leases behavior is designed for an embedded system. The
16file is written either every auto_time seconds, or when a SIGUSR1 16file is written either every auto_time seconds, or when a SIGUSR1
17is received (the auto_time timer restarts if a SIGUSR1 is received). 17is received (the auto_time timer restarts if a SIGUSR1 is received).
18If you send a SIGTERM to udhcpd directly after a SIGUSR1, udhcpd will 18If you send a SIGTERM to udhcpd directly after a SIGUSR1, udhcpd will
19finish writing the leases file and wait for the aftermentioned script 19finish writing the leases file and wait for the aftermentioned script
20to be executed and finish before quiting, so you do not need to sleep 20to be executed and finish before quiting, so you do not need to sleep
@@ -50,10 +50,10 @@ available options and comments describing them in samples/udhcpd.conf
50 50
51compile time options 51compile time options
52------------------- 52-------------------
53 53
54dhcpd.h contains the other two compile time options: 54dhcpd.h contains the other two compile time options:
55 55
56 LEASE_TIME: The default lease time if not specified in the config 56 LEASE_TIME: The default lease time if not specified in the config
57 file. 57 file.
58 58
59 DHCPD_CONFIG_FILE: The defualt config file to use. 59 DHCPD_CONFIG_FILE: The defualt config file to use.
diff --git a/networking/udhcp/arpping.c b/networking/udhcp/arpping.c
index 23c7d46b3..ab4c6d20c 100644
--- a/networking/udhcp/arpping.c
+++ b/networking/udhcp/arpping.c
@@ -25,8 +25,8 @@
25 * interface - interface to use 25 * interface - interface to use
26 * retn: 1 addr free 26 * retn: 1 addr free
27 * 0 addr used 27 * 0 addr used
28 * -1 error 28 * -1 error
29 */ 29 */
30 30
31/* FIXME: match response against chaddr */ 31/* FIXME: match response against chaddr */
32int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface) 32int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
@@ -51,7 +51,7 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
51#endif 51#endif
52 return -1; 52 return -1;
53 } 53 }
54 54
55 if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(optval)) == -1) { 55 if (setsockopt(s, SOL_SOCKET, SO_BROADCAST, &optval, sizeof(optval)) == -1) {
56 LOG(LOG_ERR, "Could not setsocketopt on raw socket"); 56 LOG(LOG_ERR, "Could not setsocketopt on raw socket");
57 close(s); 57 close(s);
@@ -71,12 +71,12 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
71 memcpy(arp.sInaddr, &ip, sizeof(ip)); /* source IP address */ 71 memcpy(arp.sInaddr, &ip, sizeof(ip)); /* source IP address */
72 memcpy(arp.sHaddr, mac, 6); /* source hardware address */ 72 memcpy(arp.sHaddr, mac, 6); /* source hardware address */
73 memcpy(arp.tInaddr, &yiaddr, sizeof(yiaddr)); /* target IP address */ 73 memcpy(arp.tInaddr, &yiaddr, sizeof(yiaddr)); /* target IP address */
74 74
75 memset(&addr, 0, sizeof(addr)); 75 memset(&addr, 0, sizeof(addr));
76 strcpy(addr.sa_data, interface); 76 strcpy(addr.sa_data, interface);
77 if (sendto(s, &arp, sizeof(arp), 0, &addr, sizeof(addr)) < 0) 77 if (sendto(s, &arp, sizeof(arp), 0, &addr, sizeof(addr)) < 0)
78 rv = 0; 78 rv = 0;
79 79
80 /* wait arp reply, and check it */ 80 /* wait arp reply, and check it */
81 tm.tv_usec = 0; 81 tm.tv_usec = 0;
82 time(&prevTime); 82 time(&prevTime);
@@ -89,8 +89,8 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
89 if (errno != EINTR) rv = 0; 89 if (errno != EINTR) rv = 0;
90 } else if (FD_ISSET(s, &fdset)) { 90 } else if (FD_ISSET(s, &fdset)) {
91 if (recv(s, &arp, sizeof(arp), 0) < 0 ) rv = 0; 91 if (recv(s, &arp, sizeof(arp), 0) < 0 ) rv = 0;
92 if (arp.operation == htons(ARPOP_REPLY) && 92 if (arp.operation == htons(ARPOP_REPLY) &&
93 bcmp(arp.tHaddr, mac, 6) == 0 && 93 bcmp(arp.tHaddr, mac, 6) == 0 &&
94 *((uint32_t *) arp.sInaddr) == yiaddr) { 94 *((uint32_t *) arp.sInaddr) == yiaddr) {
95 DEBUG(LOG_INFO, "Valid arp reply receved for this address"); 95 DEBUG(LOG_INFO, "Valid arp reply receved for this address");
96 rv = 0; 96 rv = 0;
@@ -101,6 +101,6 @@ int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *mac, char *interface)
101 time(&prevTime); 101 time(&prevTime);
102 } 102 }
103 close(s); 103 close(s);
104 DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V"); 104 DEBUG(LOG_INFO, "%salid arp replies for this address", rv ? "No v" : "V");
105 return rv; 105 return rv;
106} 106}
diff --git a/networking/udhcp/arpping.h b/networking/udhcp/arpping.h
index 6cbd2979f..6f27d9f75 100644
--- a/networking/udhcp/arpping.h
+++ b/networking/udhcp/arpping.h
@@ -15,7 +15,7 @@ struct arpMsg {
15 u_char h_dest[6]; /* destination ether addr */ 15 u_char h_dest[6]; /* destination ether addr */
16 u_char h_source[6]; /* source ether addr */ 16 u_char h_source[6]; /* source ether addr */
17 u_short h_proto; /* packet type ID field */ 17 u_short h_proto; /* packet type ID field */
18 18
19 /* ARP packet */ 19 /* ARP packet */
20 uint16_t htype; /* hardware type (must be ARPHRD_ETHER) */ 20 uint16_t htype; /* hardware type (must be ARPHRD_ETHER) */
21 uint16_t ptype; /* protocol type (must be ETH_P_IP) */ 21 uint16_t ptype; /* protocol type (must be ETH_P_IP) */
diff --git a/networking/udhcp/clientpacket.c b/networking/udhcp/clientpacket.c
index 6838c07e8..5b27004f9 100644
--- a/networking/udhcp/clientpacket.c
+++ b/networking/udhcp/clientpacket.c
@@ -18,7 +18,7 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22#include <string.h> 22#include <string.h>
23#include <sys/socket.h> 23#include <sys/socket.h>
24#include <features.h> 24#include <features.h>
@@ -73,7 +73,7 @@ static void init_packet(struct dhcpMessage *packet, char type)
73 char vendor, length; 73 char vendor, length;
74 char str[sizeof("udhcp "VERSION)]; 74 char str[sizeof("udhcp "VERSION)];
75 } vendor_id = { DHCP_VENDOR, sizeof("udhcp "VERSION) - 1, "udhcp "VERSION}; 75 } vendor_id = { DHCP_VENDOR, sizeof("udhcp "VERSION) - 1, "udhcp "VERSION};
76 76
77 init_header(packet, type); 77 init_header(packet, type);
78 memcpy(packet->chaddr, client_config.arp, 6); 78 memcpy(packet->chaddr, client_config.arp, 6);
79 add_option_string(packet->options, client_config.clientid); 79 add_option_string(packet->options, client_config.clientid);
@@ -112,7 +112,7 @@ int send_discover(unsigned long xid, unsigned long requested)
112 112
113 add_requests(&packet); 113 add_requests(&packet);
114 LOG(LOG_DEBUG, "Sending discover..."); 114 LOG(LOG_DEBUG, "Sending discover...");
115 return raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST, 115 return raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST,
116 SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex); 116 SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex);
117} 117}
118 118
@@ -128,11 +128,11 @@ int send_selecting(unsigned long xid, unsigned long server, unsigned long reques
128 128
129 add_simple_option(packet.options, DHCP_REQUESTED_IP, requested); 129 add_simple_option(packet.options, DHCP_REQUESTED_IP, requested);
130 add_simple_option(packet.options, DHCP_SERVER_ID, server); 130 add_simple_option(packet.options, DHCP_SERVER_ID, server);
131 131
132 add_requests(&packet); 132 add_requests(&packet);
133 addr.s_addr = requested; 133 addr.s_addr = requested;
134 LOG(LOG_DEBUG, "Sending select for %s...", inet_ntoa(addr)); 134 LOG(LOG_DEBUG, "Sending select for %s...", inet_ntoa(addr));
135 return raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST, 135 return raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST,
136 SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex); 136 SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex);
137} 137}
138 138
@@ -149,12 +149,12 @@ int send_renew(unsigned long xid, unsigned long server, unsigned long ciaddr)
149 149
150 add_requests(&packet); 150 add_requests(&packet);
151 LOG(LOG_DEBUG, "Sending renew..."); 151 LOG(LOG_DEBUG, "Sending renew...");
152 if (server) 152 if (server)
153 ret = kernel_packet(&packet, ciaddr, CLIENT_PORT, server, SERVER_PORT); 153 ret = kernel_packet(&packet, ciaddr, CLIENT_PORT, server, SERVER_PORT);
154 else ret = raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST, 154 else ret = raw_packet(&packet, INADDR_ANY, CLIENT_PORT, INADDR_BROADCAST,
155 SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex); 155 SERVER_PORT, MAC_BCAST_ADDR, client_config.ifindex);
156 return ret; 156 return ret;
157} 157}
158 158
159 159
160/* Unicasts a DHCP release message */ 160/* Unicasts a DHCP release message */
@@ -165,7 +165,7 @@ int send_release(unsigned long server, unsigned long ciaddr)
165 init_packet(&packet, DHCPRELEASE); 165 init_packet(&packet, DHCPRELEASE);
166 packet.xid = random_xid(); 166 packet.xid = random_xid();
167 packet.ciaddr = ciaddr; 167 packet.ciaddr = ciaddr;
168 168
169 add_simple_option(packet.options, DHCP_REQUESTED_IP, ciaddr); 169 add_simple_option(packet.options, DHCP_REQUESTED_IP, ciaddr);
170 add_simple_option(packet.options, DHCP_SERVER_ID, server); 170 add_simple_option(packet.options, DHCP_SERVER_ID, server);
171 171
@@ -189,20 +189,20 @@ int get_raw_packet(struct dhcpMessage *payload, int fd)
189 usleep(500000); /* possible down interface, looping condition */ 189 usleep(500000); /* possible down interface, looping condition */
190 return -1; 190 return -1;
191 } 191 }
192 192
193 if (bytes < (int) (sizeof(struct iphdr) + sizeof(struct udphdr))) { 193 if (bytes < (int) (sizeof(struct iphdr) + sizeof(struct udphdr))) {
194 DEBUG(LOG_INFO, "message too short, ignoring"); 194 DEBUG(LOG_INFO, "message too short, ignoring");
195 return -2; 195 return -2;
196 } 196 }
197 197
198 if (bytes < ntohs(packet.ip.tot_len)) { 198 if (bytes < ntohs(packet.ip.tot_len)) {
199 DEBUG(LOG_INFO, "Truncated packet"); 199 DEBUG(LOG_INFO, "Truncated packet");
200 return -2; 200 return -2;
201 } 201 }
202 202
203 /* ignore any extra garbage bytes */ 203 /* ignore any extra garbage bytes */
204 bytes = ntohs(packet.ip.tot_len); 204 bytes = ntohs(packet.ip.tot_len);
205 205
206 /* Make sure its the right packet for us, and that it passes sanity checks */ 206 /* Make sure its the right packet for us, and that it passes sanity checks */
207 if (packet.ip.protocol != IPPROTO_UDP || packet.ip.version != IPVERSION || 207 if (packet.ip.protocol != IPPROTO_UDP || packet.ip.version != IPVERSION ||
208 packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) || 208 packet.ip.ihl != sizeof(packet.ip) >> 2 || packet.udp.dest != htons(CLIENT_PORT) ||
@@ -219,7 +219,7 @@ int get_raw_packet(struct dhcpMessage *payload, int fd)
219 DEBUG(LOG_INFO, "bad IP header checksum, ignoring"); 219 DEBUG(LOG_INFO, "bad IP header checksum, ignoring");
220 return -1; 220 return -1;
221 } 221 }
222 222
223 /* verify the UDP checksum by replacing the header with a psuedo header */ 223 /* verify the UDP checksum by replacing the header with a psuedo header */
224 source = packet.ip.saddr; 224 source = packet.ip.saddr;
225 dest = packet.ip.daddr; 225 dest = packet.ip.daddr;
@@ -235,14 +235,14 @@ int get_raw_packet(struct dhcpMessage *payload, int fd)
235 DEBUG(LOG_ERR, "packet with bad UDP checksum received, ignoring"); 235 DEBUG(LOG_ERR, "packet with bad UDP checksum received, ignoring");
236 return -2; 236 return -2;
237 } 237 }
238 238
239 memcpy(payload, &(packet.data), bytes - (sizeof(packet.ip) + sizeof(packet.udp))); 239 memcpy(payload, &(packet.data), bytes - (sizeof(packet.ip) + sizeof(packet.udp)));
240 240
241 if (ntohl(payload->cookie) != DHCP_MAGIC) { 241 if (ntohl(payload->cookie) != DHCP_MAGIC) {
242 LOG(LOG_ERR, "received bogus message (bad magic) -- ignoring"); 242 LOG(LOG_ERR, "received bogus message (bad magic) -- ignoring");
243 return -2; 243 return -2;
244 } 244 }
245 DEBUG(LOG_INFO, "oooooh!!! got some!"); 245 DEBUG(LOG_INFO, "oooooh!!! got some!");
246 return bytes - (sizeof(packet.ip) + sizeof(packet.udp)); 246 return bytes - (sizeof(packet.ip) + sizeof(packet.udp));
247 247
248} 248}
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 8542c664c..5dad7d51c 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -55,7 +55,7 @@ static inline void sanitize_fds(void)
55void background(const char *pidfile) 55void background(const char *pidfile)
56{ 56{
57#ifdef __uClinux__ 57#ifdef __uClinux__
58 LOG(LOG_ERR, "Cannot background in uclinux (yet)"); 58 LOG(LOG_ERR, "Cannot background in uclinux (yet)");
59#else /* __uClinux__ */ 59#else /* __uClinux__ */
60 int pid_fd; 60 int pid_fd;
61 61
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index 78eb1c147..677bbfd17 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -43,7 +43,7 @@ void background(const char *pidfile);
43void start_log_and_pid(const char *client_server, const char *pidfile); 43void start_log_and_pid(const char *client_server, const char *pidfile);
44void background(const char *pidfile); 44void background(const char *pidfile);
45void udhcp_logging(int level, const char *fmt, ...); 45void udhcp_logging(int level, const char *fmt, ...);
46 46
47#define LOG(level, str, args...) udhcp_logging(level, str, ## args) 47#define LOG(level, str, args...) udhcp_logging(level, str, ## args)
48 48
49#ifdef UDHCP_DEBUG 49#ifdef UDHCP_DEBUG
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 2ba42d295..dda678933 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -18,7 +18,7 @@
18 * along with this program; if not, write to the Free Software 18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */ 20 */
21 21
22#include <sys/time.h> 22#include <sys/time.h>
23#include <sys/file.h> 23#include <sys/file.h>
24#include <unistd.h> 24#include <unistd.h>
@@ -152,7 +152,7 @@ static void perform_release(void)
152 temp_addr.s_addr = server_addr; 152 temp_addr.s_addr = server_addr;
153 sprintf(buffer, "%s", inet_ntoa(temp_addr)); 153 sprintf(buffer, "%s", inet_ntoa(temp_addr));
154 temp_addr.s_addr = requested_ip; 154 temp_addr.s_addr = requested_ip;
155 LOG(LOG_INFO, "Unicasting a release of %s to %s", 155 LOG(LOG_INFO, "Unicasting a release of %s to %s",
156 inet_ntoa(temp_addr), buffer); 156 inet_ntoa(temp_addr), buffer);
157 send_release(server_addr, requested_ip); /* unicast */ 157 send_release(server_addr, requested_ip); /* unicast */
158 run_script(NULL, "deconfig"); 158 run_script(NULL, "deconfig");
@@ -213,7 +213,7 @@ int main(int argc, char *argv[])
213 int option_index = 0; 213 int option_index = 0;
214 c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index); 214 c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index);
215 if (c == -1) break; 215 if (c == -1) break;
216 216
217 switch (c) { 217 switch (c) {
218 case 'c': 218 case 'c':
219 len = strlen(optarg) > 255 ? 255 : strlen(optarg); 219 len = strlen(optarg) > 255 ? 255 : strlen(optarg);
@@ -269,10 +269,10 @@ int main(int argc, char *argv[])
269 /* Start the log, sanitize fd's, and write a pid file */ 269 /* Start the log, sanitize fd's, and write a pid file */
270 start_log_and_pid("udhcpc", client_config.pidfile); 270 start_log_and_pid("udhcpc", client_config.pidfile);
271 271
272 if (read_interface(client_config.interface, &client_config.ifindex, 272 if (read_interface(client_config.interface, &client_config.ifindex,
273 NULL, client_config.arp) < 0) 273 NULL, client_config.arp) < 0)
274 return 1; 274 return 1;
275 275
276 if (!client_config.clientid) { 276 if (!client_config.clientid) {
277 client_config.clientid = xmalloc(6 + 3); 277 client_config.clientid = xmalloc(6 + 3);
278 client_config.clientid[OPT_CODE] = DHCP_CLIENT_ID; 278 client_config.clientid[OPT_CODE] = DHCP_CLIENT_ID;
@@ -282,8 +282,8 @@ int main(int argc, char *argv[])
282 } 282 }
283 283
284 /* setup the signal pipe */ 284 /* setup the signal pipe */
285 udhcp_sp_setup(); 285 udhcp_sp_setup();
286 286
287 state = INIT_SELECTING; 287 state = INIT_SELECTING;
288 run_script(NULL, "deconfig"); 288 run_script(NULL, "deconfig");
289 change_mode(LISTEN_RAW); 289 change_mode(LISTEN_RAW);
@@ -321,7 +321,7 @@ int main(int argc, char *argv[])
321 321
322 /* send discover packet */ 322 /* send discover packet */
323 send_discover(xid, requested_ip); /* broadcast */ 323 send_discover(xid, requested_ip); /* broadcast */
324 324
325 timeout = now + ((packet_num == 2) ? 4 : 2); 325 timeout = now + ((packet_num == 2) ? 4 : 2);
326 packet_num++; 326 packet_num++;
327 } else { 327 } else {
@@ -345,7 +345,7 @@ int main(int argc, char *argv[])
345 if (state == RENEW_REQUESTED) 345 if (state == RENEW_REQUESTED)
346 send_renew(xid, server_addr, requested_ip); /* unicast */ 346 send_renew(xid, server_addr, requested_ip); /* unicast */
347 else send_selecting(xid, server_addr, requested_ip); /* broadcast */ 347 else send_selecting(xid, server_addr, requested_ip); /* broadcast */
348 348
349 timeout = now + ((packet_num == 2) ? 10 : 2); 349 timeout = now + ((packet_num == 2) ? 10 : 2);
350 packet_num++; 350 packet_num++;
351 } else { 351 } else {
@@ -373,7 +373,7 @@ int main(int argc, char *argv[])
373 } else { 373 } else {
374 /* send a request packet */ 374 /* send a request packet */
375 send_renew(xid, server_addr, requested_ip); /* unicast */ 375 send_renew(xid, server_addr, requested_ip); /* unicast */
376 376
377 t1 = (t2 - t1) / 2 + t1; 377 t1 = (t2 - t1) / 2 + t1;
378 timeout = t1 + start; 378 timeout = t1 + start;
379 } 379 }
@@ -403,28 +403,28 @@ int main(int argc, char *argv[])
403 } 403 }
404 } else if (retval > 0 && listen_mode != LISTEN_NONE && FD_ISSET(fd, &rfds)) { 404 } else if (retval > 0 && listen_mode != LISTEN_NONE && FD_ISSET(fd, &rfds)) {
405 /* a packet is ready, read it */ 405 /* a packet is ready, read it */
406 406
407 if (listen_mode == LISTEN_KERNEL) 407 if (listen_mode == LISTEN_KERNEL)
408 len = get_packet(&packet, fd); 408 len = get_packet(&packet, fd);
409 else len = get_raw_packet(&packet, fd); 409 else len = get_raw_packet(&packet, fd);
410 410
411 if (len == -1 && errno != EINTR) { 411 if (len == -1 && errno != EINTR) {
412 DEBUG(LOG_INFO, "error on read, %m, reopening socket"); 412 DEBUG(LOG_INFO, "error on read, %m, reopening socket");
413 change_mode(listen_mode); /* just close and reopen */ 413 change_mode(listen_mode); /* just close and reopen */
414 } 414 }
415 if (len < 0) continue; 415 if (len < 0) continue;
416 416
417 if (packet.xid != xid) { 417 if (packet.xid != xid) {
418 DEBUG(LOG_INFO, "Ignoring XID %lx (our xid is %lx)", 418 DEBUG(LOG_INFO, "Ignoring XID %lx (our xid is %lx)",
419 (unsigned long) packet.xid, xid); 419 (unsigned long) packet.xid, xid);
420 continue; 420 continue;
421 } 421 }
422 422
423 if ((message = get_option(&packet, DHCP_MESSAGE_TYPE)) == NULL) { 423 if ((message = get_option(&packet, DHCP_MESSAGE_TYPE)) == NULL) {
424 DEBUG(LOG_ERR, "couldnt get option from packet -- ignoring"); 424 DEBUG(LOG_ERR, "couldnt get option from packet -- ignoring");
425 continue; 425 continue;
426 } 426 }
427 427
428 switch (state) { 428 switch (state) {
429 case INIT_SELECTING: 429 case INIT_SELECTING:
430 /* Must be a DHCPOFFER to one of our xid's */ 430 /* Must be a DHCPOFFER to one of our xid's */
@@ -433,7 +433,7 @@ int main(int argc, char *argv[])
433 memcpy(&server_addr, temp, 4); 433 memcpy(&server_addr, temp, 4);
434 xid = packet.xid; 434 xid = packet.xid;
435 requested_ip = packet.yiaddr; 435 requested_ip = packet.yiaddr;
436 436
437 /* enter requesting state */ 437 /* enter requesting state */
438 state = REQUESTING; 438 state = REQUESTING;
439 timeout = now; 439 timeout = now;
@@ -455,14 +455,14 @@ int main(int argc, char *argv[])
455 memcpy(&lease, temp, 4); 455 memcpy(&lease, temp, 4);
456 lease = ntohl(lease); 456 lease = ntohl(lease);
457 } 457 }
458 458
459 /* enter bound state */ 459 /* enter bound state */
460 t1 = lease / 2; 460 t1 = lease / 2;
461 461
462 /* little fixed point for n * .875 */ 462 /* little fixed point for n * .875 */
463 t2 = (lease * 0x7) >> 3; 463 t2 = (lease * 0x7) >> 3;
464 temp_addr.s_addr = packet.yiaddr; 464 temp_addr.s_addr = packet.yiaddr;
465 LOG(LOG_INFO, "Lease of %s obtained, lease time %ld", 465 LOG(LOG_INFO, "Lease of %s obtained, lease time %ld",
466 inet_ntoa(temp_addr), lease); 466 inet_ntoa(temp_addr), lease);
467 start = now; 467 start = now;
468 timeout = t1 + start; 468 timeout = t1 + start;
@@ -472,7 +472,7 @@ int main(int argc, char *argv[])
472 472
473 state = BOUND; 473 state = BOUND;
474 change_mode(LISTEN_NONE); 474 change_mode(LISTEN_NONE);
475 if (client_config.quit_after_lease) 475 if (client_config.quit_after_lease)
476 return 0; 476 return 0;
477 if (!client_config.foreground) 477 if (!client_config.foreground)
478 client_background(); 478 client_background();
@@ -492,10 +492,10 @@ int main(int argc, char *argv[])
492 } 492 }
493 break; 493 break;
494 /* case BOUND, RELEASED: - ignore all packets */ 494 /* case BOUND, RELEASED: - ignore all packets */
495 } 495 }
496 } else if (retval > 0 && (sig = udhcp_sp_read(&rfds))) { 496 } else if (retval > 0 && (sig = udhcp_sp_read(&rfds))) {
497 switch (sig) { 497 switch (sig) {
498 case SIGUSR1: 498 case SIGUSR1:
499 perform_renew(); 499 perform_renew();
500 break; 500 break;
501 case SIGUSR2: 501 case SIGUSR2:
@@ -506,12 +506,12 @@ int main(int argc, char *argv[])
506 return 0; 506 return 0;
507 } 507 }
508 } else if (retval == -1 && errno == EINTR) { 508 } else if (retval == -1 && errno == EINTR) {
509 /* a signal was caught */ 509 /* a signal was caught */
510 } else { 510 } else {
511 /* An error occured */ 511 /* An error occured */
512 DEBUG(LOG_ERR, "Error on select"); 512 DEBUG(LOG_ERR, "Error on select");
513 } 513 }
514 514
515 } 515 }
516 return 0; 516 return 0;
517} 517}
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 8c944f243..6f38f07f7 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -51,12 +51,12 @@ struct dhcpOfferedAddr *leases;
51struct server_config_t server_config; 51struct server_config_t server_config;
52 52
53 53
54#ifdef COMBINED_BINARY 54#ifdef COMBINED_BINARY
55int udhcpd_main(int argc, char *argv[]) 55int udhcpd_main(int argc, char *argv[])
56#else 56#else
57int main(int argc, char *argv[]) 57int main(int argc, char *argv[])
58#endif 58#endif
59{ 59{
60 fd_set rfds; 60 fd_set rfds;
61 struct timeval tv; 61 struct timeval tv;
62 int server_socket = -1; 62 int server_socket = -1;
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
70 struct dhcpOfferedAddr *lease; 70 struct dhcpOfferedAddr *lease;
71 int max_sock; 71 int max_sock;
72 unsigned long num_ips; 72 unsigned long num_ips;
73 73
74 memset(&server_config, 0, sizeof(struct server_config_t)); 74 memset(&server_config, 0, sizeof(struct server_config_t));
75 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]); 75 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
76 76
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
82 server_config.lease = ntohl(server_config.lease); 82 server_config.lease = ntohl(server_config.lease);
83 } 83 }
84 else server_config.lease = LEASE_TIME; 84 else server_config.lease = LEASE_TIME;
85 85
86 /* Sanity check */ 86 /* Sanity check */
87 num_ips = ntohl(server_config.end) - ntohl(server_config.start); 87 num_ips = ntohl(server_config.end) - ntohl(server_config.start);
88 if (server_config.max_leases > num_ips) { 88 if (server_config.max_leases > num_ips) {
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
113 if ((server_socket = listen_socket(INADDR_ANY, SERVER_PORT, server_config.interface)) < 0) { 113 if ((server_socket = listen_socket(INADDR_ANY, SERVER_PORT, server_config.interface)) < 0) {
114 LOG(LOG_ERR, "FATAL: couldn't create server socket, %m"); 114 LOG(LOG_ERR, "FATAL: couldn't create server socket, %m");
115 return 2; 115 return 2;
116 } 116 }
117 117
118 max_sock = udhcp_sp_fd_set(&rfds, server_socket); 118 max_sock = udhcp_sp_fd_set(&rfds, server_socket);
119 if (server_config.auto_time) { 119 if (server_config.auto_time) {
@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
121 tv.tv_usec = 0; 121 tv.tv_usec = 0;
122 } 122 }
123 if (!server_config.auto_time || tv.tv_sec > 0) { 123 if (!server_config.auto_time || tv.tv_sec > 0) {
124 retval = select(max_sock + 1, &rfds, NULL, NULL, 124 retval = select(max_sock + 1, &rfds, NULL, NULL,
125 server_config.auto_time ? &tv : NULL); 125 server_config.auto_time ? &tv : NULL);
126 } else retval = 0; /* If we already timed out, fall through */ 126 } else retval = 0; /* If we already timed out, fall through */
127 127
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
133 DEBUG(LOG_INFO, "error on select"); 133 DEBUG(LOG_INFO, "error on select");
134 continue; 134 continue;
135 } 135 }
136 136
137 switch (udhcp_sp_read(&rfds)) { 137 switch (udhcp_sp_read(&rfds)) {
138 case SIGUSR1: 138 case SIGUSR1:
139 LOG(LOG_INFO, "Received a SIGUSR1"); 139 LOG(LOG_INFO, "Received a SIGUSR1");
@@ -161,17 +161,17 @@ int main(int argc, char *argv[])
161 DEBUG(LOG_ERR, "couldn't get option from packet, ignoring"); 161 DEBUG(LOG_ERR, "couldn't get option from packet, ignoring");
162 continue; 162 continue;
163 } 163 }
164 164
165 /* ADDME: look for a static lease */ 165 /* ADDME: look for a static lease */
166 lease = find_lease_by_chaddr(packet.chaddr); 166 lease = find_lease_by_chaddr(packet.chaddr);
167 switch (state[0]) { 167 switch (state[0]) {
168 case DHCPDISCOVER: 168 case DHCPDISCOVER:
169 DEBUG(LOG_INFO,"received DISCOVER"); 169 DEBUG(LOG_INFO,"received DISCOVER");
170 170
171 if (sendOffer(&packet) < 0) { 171 if (sendOffer(&packet) < 0) {
172 LOG(LOG_ERR, "send OFFER failed"); 172 LOG(LOG_ERR, "send OFFER failed");
173 } 173 }
174 break; 174 break;
175 case DHCPREQUEST: 175 case DHCPREQUEST:
176 DEBUG(LOG_INFO, "received REQUEST"); 176 DEBUG(LOG_INFO, "received REQUEST");
177 177
@@ -180,12 +180,12 @@ int main(int argc, char *argv[])
180 180
181 if (requested) memcpy(&requested_align, requested, 4); 181 if (requested) memcpy(&requested_align, requested, 4);
182 if (server_id) memcpy(&server_id_align, server_id, 4); 182 if (server_id) memcpy(&server_id_align, server_id, 4);
183 183
184 if (lease) { /*ADDME: or static lease */ 184 if (lease) { /*ADDME: or static lease */
185 if (server_id) { 185 if (server_id) {
186 /* SELECTING State */ 186 /* SELECTING State */
187 DEBUG(LOG_INFO, "server_id = %08x", ntohl(server_id_align)); 187 DEBUG(LOG_INFO, "server_id = %08x", ntohl(server_id_align));
188 if (server_id_align == server_config.server && requested && 188 if (server_id_align == server_config.server && requested &&
189 requested_align == lease->yiaddr) { 189 requested_align == lease->yiaddr) {
190 sendACK(&packet, lease->yiaddr); 190 sendACK(&packet, lease->yiaddr);
191 } 191 }
@@ -203,9 +203,9 @@ int main(int argc, char *argv[])
203 /* don't know what to do!!!! */ 203 /* don't know what to do!!!! */
204 sendNAK(&packet); 204 sendNAK(&packet);
205 } 205 }
206 } 206 }
207 } 207 }
208 208
209 /* what to do if we have no record of the client */ 209 /* what to do if we have no record of the client */
210 } else if (server_id) { 210 } else if (server_id) {
211 /* SELECTING State */ 211 /* SELECTING State */
@@ -218,7 +218,7 @@ int main(int argc, char *argv[])
218 memset(lease->chaddr, 0, 16); 218 memset(lease->chaddr, 0, 16);
219 /* make some contention for this address */ 219 /* make some contention for this address */
220 } else sendNAK(&packet); 220 } else sendNAK(&packet);
221 } else if (requested_align < server_config.start || 221 } else if (requested_align < server_config.start ||
222 requested_align > server_config.end) { 222 requested_align > server_config.end) {
223 sendNAK(&packet); 223 sendNAK(&packet);
224 } /* else remain silent */ 224 } /* else remain silent */
@@ -232,7 +232,7 @@ int main(int argc, char *argv[])
232 if (lease) { 232 if (lease) {
233 memset(lease->chaddr, 0, 16); 233 memset(lease->chaddr, 0, 16);
234 lease->expires = time(0) + server_config.decline_time; 234 lease->expires = time(0) + server_config.decline_time;
235 } 235 }
236 break; 236 break;
237 case DHCPRELEASE: 237 case DHCPRELEASE:
238 DEBUG(LOG_INFO,"received RELEASE"); 238 DEBUG(LOG_INFO,"received RELEASE");
@@ -241,7 +241,7 @@ int main(int argc, char *argv[])
241 case DHCPINFORM: 241 case DHCPINFORM:
242 DEBUG(LOG_INFO,"received INFORM"); 242 DEBUG(LOG_INFO,"received INFORM");
243 send_inform(&packet); 243 send_inform(&packet);
244 break; 244 break;
245 default: 245 default:
246 LOG(LOG_WARNING, "unsupported DHCP message (%02x) -- ignoring", state[0]); 246 LOG(LOG_WARNING, "unsupported DHCP message (%02x) -- ignoring", state[0]);
247 } 247 }
diff --git a/networking/udhcp/dhcpd.h b/networking/udhcp/dhcpd.h
index 925634461..39658a8ff 100644
--- a/networking/udhcp/dhcpd.h
+++ b/networking/udhcp/dhcpd.h
@@ -124,10 +124,10 @@ struct server_config_t {
124 uint32_t siaddr; /* next server bootp option */ 124 uint32_t siaddr; /* next server bootp option */
125 char *sname; /* bootp server name */ 125 char *sname; /* bootp server name */
126 char *boot_file; /* bootp boot file option */ 126 char *boot_file; /* bootp boot file option */
127}; 127};
128 128
129extern struct server_config_t server_config; 129extern struct server_config_t server_config;
130extern struct dhcpOfferedAddr *leases; 130extern struct dhcpOfferedAddr *leases;
131 131
132 132
133#endif 133#endif
diff --git a/networking/udhcp/dumpleases.c b/networking/udhcp/dumpleases.c
index e2b19315d..a9036dfbd 100644
--- a/networking/udhcp/dumpleases.c
+++ b/networking/udhcp/dumpleases.c
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
47 const char *file = LEASES_FILE; 47 const char *file = LEASES_FILE;
48 struct dhcpOfferedAddr lease; 48 struct dhcpOfferedAddr lease;
49 struct in_addr addr; 49 struct in_addr addr;
50 50
51 static const struct option options[] = { 51 static const struct option options[] = {
52 {"absolute", 0, 0, 'a'}, 52 {"absolute", 0, 0, 'a'},
53 {"remaining", 0, 0, 'r'}, 53 {"remaining", 0, 0, 'r'},
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
59 int option_index = 0; 59 int option_index = 0;
60 c = getopt_long(argc, argv, "arf:", options, &option_index); 60 c = getopt_long(argc, argv, "arf:", options, &option_index);
61 if (c == -1) break; 61 if (c == -1) break;
62 62
63 switch (c) { 63 switch (c) {
64 case 'a': mode = ABSOLUTE; break; 64 case 'a': mode = ABSOLUTE; break;
65 case 'r': mode = REMAINING; break; 65 case 'r': mode = REMAINING; break;
@@ -70,10 +70,10 @@ int main(int argc, char *argv[])
70 show_usage(); 70 show_usage();
71 } 71 }
72 } 72 }
73 73
74 fp = xfopen(file, "r"); 74 fp = xfopen(file, "r");
75 75
76 printf("Mac Address IP-Address Expires %s\n", mode == REMAINING ? "in" : "at"); 76 printf("Mac Address IP-Address Expires %s\n", mode == REMAINING ? "in" : "at");
77 /* "00:00:00:00:00:00 255.255.255.255 Wed Jun 30 21:49:08 1993" */ 77 /* "00:00:00:00:00:00 255.255.255.255 Wed Jun 30 21:49:08 1993" */
78 while (fread(&lease, sizeof(lease), 1, fp)) { 78 while (fread(&lease, sizeof(lease), 1, fp)) {
79 79
@@ -105,6 +105,6 @@ int main(int argc, char *argv[])
105 } else printf("%s", ctime(&expires)); 105 } else printf("%s", ctime(&expires));
106 } 106 }
107 fclose(fp); 107 fclose(fp);
108 108
109 return 0; 109 return 0;
110} 110}
diff --git a/networking/udhcp/files.c b/networking/udhcp/files.c
index 0802bb316..89287ca2d 100644
--- a/networking/udhcp/files.c
+++ b/networking/udhcp/files.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * files.c -- DHCP server file manipulation * 2 * files.c -- DHCP server file manipulation *
3 * Rewrite by Russ Dill <Russ.Dill@asu.edu> July 2001 3 * Rewrite by Russ Dill <Russ.Dill@asu.edu> July 2001
4 */ 4 */
5 5
6#include <sys/socket.h> 6#include <sys/socket.h>
7#include <arpa/inet.h> 7#include <arpa/inet.h>
8#include <string.h> 8#include <string.h>
@@ -16,7 +16,7 @@
16#include "options.h" 16#include "options.h"
17#include "common.h" 17#include "common.h"
18 18
19/* 19/*
20 * Domain names may have 254 chars, and string options can be 254 20 * Domain names may have 254 chars, and string options can be 254
21 * chars long. However, 80 bytes will be enough for most, and won't 21 * chars long. However, 80 bytes will be enough for most, and won't
22 * hog up memory. If you have a special application, change it 22 * hog up memory. If you have a special application, change it
@@ -31,7 +31,7 @@ static int read_ip(const char *line, void *arg)
31 int retval = 1; 31 int retval = 1;
32 32
33 if (!inet_aton(line, addr)) { 33 if (!inet_aton(line, addr)) {
34 if ((host = gethostbyname(line))) 34 if ((host = gethostbyname(line)))
35 addr->s_addr = *((unsigned long *) host->h_addr_list[0]); 35 addr->s_addr = *((unsigned long *) host->h_addr_list[0]);
36 else retval = 0; 36 else retval = 0;
37 } 37 }
@@ -42,10 +42,10 @@ static int read_ip(const char *line, void *arg)
42static int read_str(const char *line, void *arg) 42static int read_str(const char *line, void *arg)
43{ 43{
44 char **dest = arg; 44 char **dest = arg;
45 45
46 if (*dest) free(*dest); 46 if (*dest) free(*dest);
47 *dest = strdup(line); 47 *dest = strdup(line);
48 48
49 return 1; 49 return 1;
50} 50}
51 51
@@ -69,7 +69,7 @@ static int read_yn(const char *line, void *arg)
69 else if (!strcasecmp("no", line)) 69 else if (!strcasecmp("no", line))
70 *dest = 0; 70 *dest = 0;
71 else retval = 0; 71 else retval = 0;
72 72
73 return retval; 73 return retval;
74} 74}
75 75
@@ -89,11 +89,11 @@ static int read_opt(const char *const_line, void *arg)
89 /* Cheat, the only const line we'll actually get is "" */ 89 /* Cheat, the only const line we'll actually get is "" */
90 line = (char *) const_line; 90 line = (char *) const_line;
91 if (!(opt = strtok(line, " \t="))) return 0; 91 if (!(opt = strtok(line, " \t="))) return 0;
92 92
93 for (option = dhcp_options; option->code; option++) 93 for (option = dhcp_options; option->code; option++)
94 if (!strcasecmp(option->name, opt)) 94 if (!strcasecmp(option->name, opt))
95 break; 95 break;
96 96
97 if (!option->code) return 0; 97 if (!option->code) return 0;
98 98
99 do { 99 do {
@@ -134,17 +134,17 @@ static int read_opt(const char *const_line, void *arg)
134 retval = (endptr[0] == '\0'); 134 retval = (endptr[0] == '\0');
135 break; 135 break;
136 case OPTION_U32: 136 case OPTION_U32:
137 *result_u32 = htonl(strtoul(val, &endptr, 0)); 137 *result_u32 = htonl(strtoul(val, &endptr, 0));
138 retval = (endptr[0] == '\0'); 138 retval = (endptr[0] == '\0');
139 break; 139 break;
140 case OPTION_S32: 140 case OPTION_S32:
141 *result_u32 = htonl(strtol(val, &endptr, 0)); 141 *result_u32 = htonl(strtol(val, &endptr, 0));
142 retval = (endptr[0] == '\0'); 142 retval = (endptr[0] == '\0');
143 break; 143 break;
144 default: 144 default:
145 break; 145 break;
146 } 146 }
147 if (retval) 147 if (retval)
148 attach_option(opt_list, option, opt, length); 148 attach_option(opt_list, option, opt, length);
149 } while (retval && option->flags & OPTION_LIST); 149 } while (retval && option->flags & OPTION_LIST);
150 return retval; 150 return retval;
@@ -193,7 +193,7 @@ int read_config(const char *file)
193 LOG(LOG_ERR, "unable to open config file: %s", file); 193 LOG(LOG_ERR, "unable to open config file: %s", file);
194 return 0; 194 return 0;
195 } 195 }
196 196
197 while (fgets(buffer, READ_CONFIG_BUF_SIZE, in)) { 197 while (fgets(buffer, READ_CONFIG_BUF_SIZE, in)) {
198 lm++; 198 lm++;
199 if (strchr(buffer, '\n')) *(strchr(buffer, '\n')) = '\0'; 199 if (strchr(buffer, '\n')) *(strchr(buffer, '\n')) = '\0';
@@ -203,14 +203,14 @@ int read_config(const char *file)
203 if (strchr(buffer, '#')) *(strchr(buffer, '#')) = '\0'; 203 if (strchr(buffer, '#')) *(strchr(buffer, '#')) = '\0';
204 204
205 if (!(token = strtok(buffer, " \t"))) continue; 205 if (!(token = strtok(buffer, " \t"))) continue;
206 if (!(line = strtok(NULL, ""))) continue; 206 if (!(line = strtok(NULL, ""))) continue;
207 207
208 /* eat leading whitespace */ 208 /* eat leading whitespace */
209 line = line + strspn(line, " \t="); 209 line = line + strspn(line, " \t=");
210 /* eat trailing whitespace */ 210 /* eat trailing whitespace */
211 for (i = strlen(line); i > 0 && isspace(line[i - 1]); i--); 211 for (i = strlen(line); i > 0 && isspace(line[i - 1]); i--);
212 line[i] = '\0'; 212 line[i] = '\0';
213 213
214 for (i = 0; keywords[i].keyword[0]; i++) 214 for (i = 0; keywords[i].keyword[0]; i++)
215 if (!strcasecmp(token, keywords[i].keyword)) 215 if (!strcasecmp(token, keywords[i].keyword))
216 if (!keywords[i].handler(line, keywords[i].var)) { 216 if (!keywords[i].handler(line, keywords[i].var)) {
@@ -232,12 +232,12 @@ void write_leases(void)
232 char buf[255]; 232 char buf[255];
233 time_t curr = time(0); 233 time_t curr = time(0);
234 unsigned long tmp_time; 234 unsigned long tmp_time;
235 235
236 if (!(fp = fopen(server_config.lease_file, "w"))) { 236 if (!(fp = fopen(server_config.lease_file, "w"))) {
237 LOG(LOG_ERR, "Unable to open %s for writing", server_config.lease_file); 237 LOG(LOG_ERR, "Unable to open %s for writing", server_config.lease_file);
238 return; 238 return;
239 } 239 }
240 240
241 for (i = 0; i < server_config.max_leases; i++) { 241 for (i = 0; i < server_config.max_leases; i++) {
242 if (leases[i].yiaddr != 0) { 242 if (leases[i].yiaddr != 0) {
243 243
@@ -257,7 +257,7 @@ void write_leases(void)
257 } 257 }
258 } 258 }
259 fclose(fp); 259 fclose(fp);
260 260
261 if (server_config.notify_file) { 261 if (server_config.notify_file) {
262 sprintf(buf, "%s %s", server_config.notify_file, server_config.lease_file); 262 sprintf(buf, "%s %s", server_config.notify_file, server_config.lease_file);
263 system(buf); 263 system(buf);
@@ -270,12 +270,12 @@ void read_leases(const char *file)
270 FILE *fp; 270 FILE *fp;
271 unsigned int i = 0; 271 unsigned int i = 0;
272 struct dhcpOfferedAddr lease; 272 struct dhcpOfferedAddr lease;
273 273
274 if (!(fp = fopen(file, "r"))) { 274 if (!(fp = fopen(file, "r"))) {
275 LOG(LOG_ERR, "Unable to open %s for reading", file); 275 LOG(LOG_ERR, "Unable to open %s for reading", file);
276 return; 276 return;
277 } 277 }
278 278
279 while (i < server_config.max_leases && (fread(&lease, sizeof lease, 1, fp) == 1)) { 279 while (i < server_config.max_leases && (fread(&lease, sizeof lease, 1, fp) == 1)) {
280 /* ADDME: is it a static lease */ 280 /* ADDME: is it a static lease */
281 if (lease.yiaddr >= server_config.start && lease.yiaddr <= server_config.end) { 281 if (lease.yiaddr >= server_config.start && lease.yiaddr <= server_config.end) {
@@ -284,7 +284,7 @@ void read_leases(const char *file)
284 if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) { 284 if (!(add_lease(lease.chaddr, lease.yiaddr, lease.expires))) {
285 LOG(LOG_WARNING, "Too many leases while loading %s\n", file); 285 LOG(LOG_WARNING, "Too many leases while loading %s\n", file);
286 break; 286 break;
287 } 287 }
288 i++; 288 i++;
289 } 289 }
290 } 290 }
diff --git a/networking/udhcp/frontend.c b/networking/udhcp/frontend.c
index de5779508..fa77ab977 100644
--- a/networking/udhcp/frontend.c
+++ b/networking/udhcp/frontend.c
@@ -7,10 +7,10 @@ int main(int argc, char *argv[])
7{ 7{
8 int ret = 0; 8 int ret = 0;
9 char *base = strrchr(argv[0], '/'); 9 char *base = strrchr(argv[0], '/');
10 10
11 if (strstr(base ? (base + 1) : argv[0], "dhcpd")) 11 if (strstr(base ? (base + 1) : argv[0], "dhcpd"))
12 ret = udhcpd_main(argc, argv); 12 ret = udhcpd_main(argc, argv);
13 else ret = udhcpc_main(argc, argv); 13 else ret = udhcpc_main(argc, argv);
14 14
15 return ret; 15 return ret;
16} 16}
diff --git a/networking/udhcp/leases.c b/networking/udhcp/leases.c
index dce056654..d478880a3 100644
--- a/networking/udhcp/leases.c
+++ b/networking/udhcp/leases.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * leases.c -- tools to manage DHCP leases 2 * leases.c -- tools to manage DHCP leases
3 * Russ Dill <Russ.Dill@asu.edu> July 2001 3 * Russ Dill <Russ.Dill@asu.edu> July 2001
4 */ 4 */
5 5
@@ -23,9 +23,9 @@ uint8_t blank_chaddr[] = {[0 ... 15] = 0};
23void clear_lease(uint8_t *chaddr, uint32_t yiaddr) 23void clear_lease(uint8_t *chaddr, uint32_t yiaddr)
24{ 24{
25 unsigned int i, j; 25 unsigned int i, j;
26 26
27 for (j = 0; j < 16 && !chaddr[j]; j++); 27 for (j = 0; j < 16 && !chaddr[j]; j++);
28 28
29 for (i = 0; i < server_config.max_leases; i++) 29 for (i = 0; i < server_config.max_leases; i++)
30 if ((j != 16 && !memcmp(leases[i].chaddr, chaddr, 16)) || 30 if ((j != 16 && !memcmp(leases[i].chaddr, chaddr, 16)) ||
31 (yiaddr && leases[i].yiaddr == yiaddr)) { 31 (yiaddr && leases[i].yiaddr == yiaddr)) {
@@ -38,18 +38,18 @@ void clear_lease(uint8_t *chaddr, uint32_t yiaddr)
38struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned long lease) 38struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned long lease)
39{ 39{
40 struct dhcpOfferedAddr *oldest; 40 struct dhcpOfferedAddr *oldest;
41 41
42 /* clean out any old ones */ 42 /* clean out any old ones */
43 clear_lease(chaddr, yiaddr); 43 clear_lease(chaddr, yiaddr);
44 44
45 oldest = oldest_expired_lease(); 45 oldest = oldest_expired_lease();
46 46
47 if (oldest) { 47 if (oldest) {
48 memcpy(oldest->chaddr, chaddr, 16); 48 memcpy(oldest->chaddr, chaddr, 16);
49 oldest->yiaddr = yiaddr; 49 oldest->yiaddr = yiaddr;
50 oldest->expires = time(0) + lease; 50 oldest->expires = time(0) + lease;
51 } 51 }
52 52
53 return oldest; 53 return oldest;
54} 54}
55 55
@@ -58,7 +58,7 @@ struct dhcpOfferedAddr *add_lease(uint8_t *chaddr, uint32_t yiaddr, unsigned lon
58int lease_expired(struct dhcpOfferedAddr *lease) 58int lease_expired(struct dhcpOfferedAddr *lease)
59{ 59{
60 return (lease->expires < (unsigned long) time(0)); 60 return (lease->expires < (unsigned long) time(0));
61} 61}
62 62
63 63
64/* Find the oldest expired lease, NULL if there are no expired leases */ 64/* Find the oldest expired lease, NULL if there are no expired leases */
@@ -68,14 +68,14 @@ struct dhcpOfferedAddr *oldest_expired_lease(void)
68 unsigned long oldest_lease = time(0); 68 unsigned long oldest_lease = time(0);
69 unsigned int i; 69 unsigned int i;
70 70
71 71
72 for (i = 0; i < server_config.max_leases; i++) 72 for (i = 0; i < server_config.max_leases; i++)
73 if (oldest_lease > leases[i].expires) { 73 if (oldest_lease > leases[i].expires) {
74 oldest_lease = leases[i].expires; 74 oldest_lease = leases[i].expires;
75 oldest = &(leases[i]); 75 oldest = &(leases[i]);
76 } 76 }
77 return oldest; 77 return oldest;
78 78
79} 79}
80 80
81 81
@@ -86,7 +86,7 @@ struct dhcpOfferedAddr *find_lease_by_chaddr(uint8_t *chaddr)
86 86
87 for (i = 0; i < server_config.max_leases; i++) 87 for (i = 0; i < server_config.max_leases; i++)
88 if (!memcmp(leases[i].chaddr, chaddr, 16)) return &(leases[i]); 88 if (!memcmp(leases[i].chaddr, chaddr, 16)) return &(leases[i]);
89 89
90 return NULL; 90 return NULL;
91} 91}
92 92
@@ -98,7 +98,7 @@ struct dhcpOfferedAddr *find_lease_by_yiaddr(uint32_t yiaddr)
98 98
99 for (i = 0; i < server_config.max_leases; i++) 99 for (i = 0; i < server_config.max_leases; i++)
100 if (leases[i].yiaddr == yiaddr) return &(leases[i]); 100 if (leases[i].yiaddr == yiaddr) return &(leases[i]);
101 101
102 return NULL; 102 return NULL;
103} 103}
104 104
@@ -120,10 +120,10 @@ static int check_ip(uint32_t addr)
120 120
121/* find an assignable address, it check_expired is true, we check all the expired leases as well. 121/* find an assignable address, it check_expired is true, we check all the expired leases as well.
122 * Maybe this should try expired leases by age... */ 122 * Maybe this should try expired leases by age... */
123uint32_t find_address(int check_expired) 123uint32_t find_address(int check_expired)
124{ 124{
125 uint32_t addr, ret; 125 uint32_t addr, ret;
126 struct dhcpOfferedAddr *lease = NULL; 126 struct dhcpOfferedAddr *lease = NULL;
127 127
128 addr = ntohl(server_config.start); /* addr is in host order here */ 128 addr = ntohl(server_config.start); /* addr is in host order here */
129 for (;addr <= ntohl(server_config.end); addr++) { 129 for (;addr <= ntohl(server_config.end); addr++) {
diff --git a/networking/udhcp/options.c b/networking/udhcp/options.c
index 1bdf25708..d75bc5aff 100644
--- a/networking/udhcp/options.c
+++ b/networking/udhcp/options.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * options.c -- DHCP server option packet tools 2 * options.c -- DHCP server option packet tools
3 * Rewrite by Russ Dill <Russ.Dill@asu.edu> July 2001 3 * Rewrite by Russ Dill <Russ.Dill@asu.edu> July 2001
4 */ 4 */
5 5
6#include <stdlib.h> 6#include <stdlib.h>
7#include <string.h> 7#include <string.h>
8 8
@@ -64,7 +64,7 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
64 int i, length; 64 int i, length;
65 uint8_t *optionptr; 65 uint8_t *optionptr;
66 int over = 0, done = 0, curr = OPTION_FIELD; 66 int over = 0, done = 0, curr = OPTION_FIELD;
67 67
68 optionptr = packet->options; 68 optionptr = packet->options;
69 i = 0; 69 i = 0;
70 length = 308; 70 length = 308;
@@ -79,7 +79,7 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
79 return NULL; 79 return NULL;
80 } 80 }
81 return optionptr + i + 2; 81 return optionptr + i + 2;
82 } 82 }
83 switch (optionptr[i + OPT_CODE]) { 83 switch (optionptr[i + OPT_CODE]) {
84 case DHCP_PADDING: 84 case DHCP_PADDING:
85 i++; 85 i++;
@@ -114,10 +114,10 @@ uint8_t *get_option(struct dhcpMessage *packet, int code)
114 114
115 115
116/* return the position of the 'end' option (no bounds checking) */ 116/* return the position of the 'end' option (no bounds checking) */
117int end_option(uint8_t *optionptr) 117int end_option(uint8_t *optionptr)
118{ 118{
119 int i = 0; 119 int i = 0;
120 120
121 while (optionptr[i] != DHCP_END) { 121 while (optionptr[i] != DHCP_END) {
122 if (optionptr[i] == DHCP_PADDING) i++; 122 if (optionptr[i] == DHCP_PADDING) i++;
123 else i += optionptr[i + OPT_LEN] + 2; 123 else i += optionptr[i + OPT_LEN] + 2;
@@ -131,7 +131,7 @@ int end_option(uint8_t *optionptr)
131int add_option_string(uint8_t *optionptr, uint8_t *string) 131int add_option_string(uint8_t *optionptr, uint8_t *string)
132{ 132{
133 int end = end_option(optionptr); 133 int end = end_option(optionptr);
134 134
135 /* end position + string length + option code/length + end option */ 135 /* end position + string length + option code/length + end option */
136 if (end + string[OPT_LEN] + 2 + 1 >= 308) { 136 if (end + string[OPT_LEN] + 2 + 1 >= 308) {
137 LOG(LOG_ERR, "Option 0x%02x did not fit into the packet!", string[OPT_CODE]); 137 LOG(LOG_ERR, "Option 0x%02x did not fit into the packet!", string[OPT_CODE]);
@@ -162,12 +162,12 @@ int add_simple_option(uint8_t *optionptr, uint8_t code, uint32_t data)
162 if (dhcp_options[i].code == code) { 162 if (dhcp_options[i].code == code) {
163 length = option_lengths[dhcp_options[i].flags & TYPE_MASK]; 163 length = option_lengths[dhcp_options[i].flags & TYPE_MASK];
164 } 164 }
165 165
166 if (!length) { 166 if (!length) {
167 DEBUG(LOG_ERR, "Could not add option 0x%02x", code); 167 DEBUG(LOG_ERR, "Could not add option 0x%02x", code);
168 return 0; 168 return 0;
169 } 169 }
170 170
171 option[OPT_CODE] = code; 171 option[OPT_CODE] = code;
172 option[OPT_LEN] = length; 172 option[OPT_LEN] = length;
173 173
@@ -202,7 +202,7 @@ void attach_option(struct option_set **opt_list, struct dhcp_option *option, cha
202 DEBUG(LOG_INFO, "Attaching option %s to existing member of list", option->name); 202 DEBUG(LOG_INFO, "Attaching option %s to existing member of list", option->name);
203 if (option->flags & OPTION_LIST) { 203 if (option->flags & OPTION_LIST) {
204 if (existing->data[OPT_LEN] + length <= 255) { 204 if (existing->data[OPT_LEN] + length <= 255) {
205 existing->data = realloc(existing->data, 205 existing->data = realloc(existing->data,
206 existing->data[OPT_LEN] + length + 2); 206 existing->data[OPT_LEN] + length + 2);
207 memcpy(existing->data + existing->data[OPT_LEN] + 2, buffer, length); 207 memcpy(existing->data + existing->data[OPT_LEN] + 2, buffer, length);
208 existing->data[OPT_LEN] += length; 208 existing->data[OPT_LEN] += length;
@@ -210,19 +210,19 @@ void attach_option(struct option_set **opt_list, struct dhcp_option *option, cha
210 } /* else, ignore the new data */ 210 } /* else, ignore the new data */
211 } else { 211 } else {
212 DEBUG(LOG_INFO, "Attaching option %s to list", option->name); 212 DEBUG(LOG_INFO, "Attaching option %s to list", option->name);
213 213
214 /* make a new option */ 214 /* make a new option */
215 new = xmalloc(sizeof(struct option_set)); 215 new = xmalloc(sizeof(struct option_set));
216 new->data = xmalloc(length + 2); 216 new->data = xmalloc(length + 2);
217 new->data[OPT_CODE] = option->code; 217 new->data[OPT_CODE] = option->code;
218 new->data[OPT_LEN] = length; 218 new->data[OPT_LEN] = length;
219 memcpy(new->data + 2, buffer, length); 219 memcpy(new->data + 2, buffer, length);
220 220
221 curr = opt_list; 221 curr = opt_list;
222 while (*curr && (*curr)->data[OPT_CODE] < option->code) 222 while (*curr && (*curr)->data[OPT_CODE] < option->code)
223 curr = &(*curr)->next; 223 curr = &(*curr)->next;
224 224
225 new->next = *curr; 225 new->next = *curr;
226 *curr = new; 226 *curr = new;
227 } 227 }
228} 228}
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index a3c7ae153..7cbd83a35 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -66,7 +66,7 @@ int get_packet(struct dhcpMessage *packet, int fd)
66 return -2; 66 return -2;
67 } 67 }
68 DEBUG(LOG_INFO, "Received a packet"); 68 DEBUG(LOG_INFO, "Received a packet");
69 69
70 if (packet->op == BOOTREQUEST && (vendor = get_option(packet, DHCP_VENDOR))) { 70 if (packet->op == BOOTREQUEST && (vendor = get_option(packet, DHCP_VENDOR))) {
71 for (i = 0; broken_vendors[i][0]; i++) { 71 for (i = 0; broken_vendors[i][0]; i++) {
72 if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) && 72 if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) &&
@@ -77,7 +77,7 @@ int get_packet(struct dhcpMessage *packet, int fd)
77 } 77 }
78 } 78 }
79 } 79 }
80 80
81 81
82 return bytes; 82 return bytes;
83} 83}
@@ -126,10 +126,10 @@ int raw_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_port,
126 DEBUG(LOG_ERR, "socket call failed: %m"); 126 DEBUG(LOG_ERR, "socket call failed: %m");
127 return -1; 127 return -1;
128 } 128 }
129 129
130 memset(&dest, 0, sizeof(dest)); 130 memset(&dest, 0, sizeof(dest));
131 memset(&packet, 0, sizeof(packet)); 131 memset(&packet, 0, sizeof(packet));
132 132
133 dest.sll_family = AF_PACKET; 133 dest.sll_family = AF_PACKET;
134 dest.sll_protocol = htons(ETH_P_IP); 134 dest.sll_protocol = htons(ETH_P_IP);
135 dest.sll_ifindex = ifindex; 135 dest.sll_ifindex = ifindex;
@@ -150,7 +150,7 @@ int raw_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_port,
150 packet.ip.tot_len = packet.udp.len; 150 packet.ip.tot_len = packet.udp.len;
151 memcpy(&(packet.data), payload, sizeof(struct dhcpMessage)); 151 memcpy(&(packet.data), payload, sizeof(struct dhcpMessage));
152 packet.udp.check = checksum(&packet, sizeof(struct udp_dhcp_packet)); 152 packet.udp.check = checksum(&packet, sizeof(struct udp_dhcp_packet));
153 153
154 packet.ip.tot_len = htons(sizeof(struct udp_dhcp_packet)); 154 packet.ip.tot_len = htons(sizeof(struct udp_dhcp_packet));
155 packet.ip.ihl = sizeof(packet.ip) >> 2; 155 packet.ip.ihl = sizeof(packet.ip) >> 2;
156 packet.ip.version = IPVERSION; 156 packet.ip.version = IPVERSION;
@@ -173,10 +173,10 @@ int kernel_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_po
173 int n = 1; 173 int n = 1;
174 int fd, result; 174 int fd, result;
175 struct sockaddr_in client; 175 struct sockaddr_in client;
176 176
177 if ((fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) 177 if ((fd = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
178 return -1; 178 return -1;
179 179
180 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &n, sizeof(n)) == -1) 180 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &n, sizeof(n)) == -1)
181 return -1; 181 return -1;
182 182
@@ -191,7 +191,7 @@ int kernel_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_po
191 memset(&client, 0, sizeof(client)); 191 memset(&client, 0, sizeof(client));
192 client.sin_family = AF_INET; 192 client.sin_family = AF_INET;
193 client.sin_port = htons(dest_port); 193 client.sin_port = htons(dest_port);
194 client.sin_addr.s_addr = dest_ip; 194 client.sin_addr.s_addr = dest_ip;
195 195
196 if (connect(fd, (struct sockaddr *)&client, sizeof(struct sockaddr)) == -1) 196 if (connect(fd, (struct sockaddr *)&client, sizeof(struct sockaddr)) == -1)
197 return -1; 197 return -1;
@@ -199,4 +199,4 @@ int kernel_packet(struct dhcpMessage *payload, uint32_t source_ip, int source_po
199 result = write(fd, payload, sizeof(struct dhcpMessage)); 199 result = write(fd, payload, sizeof(struct dhcpMessage));
200 close(fd); 200 close(fd);
201 return result; 201 return result;
202} 202}
diff --git a/networking/udhcp/packet.h b/networking/udhcp/packet.h
index 22c4d09c3..f5859e824 100644
--- a/networking/udhcp/packet.h
+++ b/networking/udhcp/packet.h
@@ -20,7 +20,7 @@ struct dhcpMessage {
20 uint8_t sname[64]; 20 uint8_t sname[64];
21 uint8_t file[128]; 21 uint8_t file[128];
22 uint32_t cookie; 22 uint32_t cookie;
23 uint8_t options[308]; /* 312 - cookie */ 23 uint8_t options[308]; /* 312 - cookie */
24}; 24};
25 25
26struct udp_dhcp_packet { 26struct udp_dhcp_packet {
diff --git a/networking/udhcp/script.c b/networking/udhcp/script.c
index b7d78624c..cae4db7af 100644
--- a/networking/udhcp/script.c
+++ b/networking/udhcp/script.c
@@ -1,6 +1,6 @@
1/* script.c 1/* script.c
2 * 2 *
3 * Functions to call the DHCP client notification scripts 3 * Functions to call the DHCP client notification scripts
4 * 4 *
5 * Russ Dill <Russ.Dill@asu.edu> July 2001 5 * Russ Dill <Russ.Dill@asu.edu> July 2001
6 * 6 *
@@ -157,7 +157,7 @@ static char **fill_envp(struct dhcpMessage *packet)
157 if (!(over & FILE_FIELD) && packet->file[0]) num_options++; 157 if (!(over & FILE_FIELD) && packet->file[0]) num_options++;
158 if (!(over & SNAME_FIELD) && packet->sname[0]) num_options++; 158 if (!(over & SNAME_FIELD) && packet->sname[0]) num_options++;
159 } 159 }
160 160
161 envp = xcalloc(sizeof(char *), num_options + 5); 161 envp = xcalloc(sizeof(char *), num_options + 5);
162 j = 0; 162 j = 0;
163 asprintf(&envp[j++], "interface=%s", client_config.interface); 163 asprintf(&envp[j++], "interface=%s", client_config.interface);
@@ -220,13 +220,13 @@ void run_script(struct dhcpMessage *packet, const char *name)
220 return; 220 return;
221 } else if (pid == 0) { 221 } else if (pid == 0) {
222 envp = fill_envp(packet); 222 envp = fill_envp(packet);
223 223
224 /* close fd's? */ 224 /* close fd's? */
225 225
226 /* exec script */ 226 /* exec script */
227 execle(client_config.script, client_config.script, 227 execle(client_config.script, client_config.script,
228 name, NULL, envp); 228 name, NULL, envp);
229 LOG(LOG_ERR, "script %s failed: %m", client_config.script); 229 LOG(LOG_ERR, "script %s failed: %m", client_config.script);
230 exit(1); 230 exit(1);
231 } 231 }
232} 232}
diff --git a/networking/udhcp/serverpacket.c b/networking/udhcp/serverpacket.c
index d39e6ba17..937436a11 100644
--- a/networking/udhcp/serverpacket.c
+++ b/networking/udhcp/serverpacket.c
@@ -45,7 +45,7 @@ static int send_packet_to_client(struct dhcpMessage *payload, int force_broadcas
45{ 45{
46 uint8_t *chaddr; 46 uint8_t *chaddr;
47 uint32_t ciaddr; 47 uint32_t ciaddr;
48 48
49 if (force_broadcast) { 49 if (force_broadcast) {
50 DEBUG(LOG_INFO, "broadcasting packet to client (NAK)"); 50 DEBUG(LOG_INFO, "broadcasting packet to client (NAK)");
51 ciaddr = INADDR_BROADCAST; 51 ciaddr = INADDR_BROADCAST;
@@ -63,7 +63,7 @@ static int send_packet_to_client(struct dhcpMessage *payload, int force_broadcas
63 ciaddr = payload->yiaddr; 63 ciaddr = payload->yiaddr;
64 chaddr = payload->chaddr; 64 chaddr = payload->chaddr;
65 } 65 }
66 return raw_packet(payload, server_config.server, SERVER_PORT, 66 return raw_packet(payload, server_config.server, SERVER_PORT,
67 ciaddr, CLIENT_PORT, chaddr, server_config.ifindex); 67 ciaddr, CLIENT_PORT, chaddr, server_config.ifindex);
68} 68}
69 69
@@ -101,7 +101,7 @@ static void add_bootp_options(struct dhcpMessage *packet)
101 if (server_config.boot_file) 101 if (server_config.boot_file)
102 strncpy(packet->file, server_config.boot_file, sizeof(packet->file) - 1); 102 strncpy(packet->file, server_config.boot_file, sizeof(packet->file) - 1);
103} 103}
104 104
105 105
106/* send a DHCP OFFER to a DHCP DISCOVER */ 106/* send a DHCP OFFER to a DHCP DISCOVER */
107int sendOffer(struct dhcpMessage *oldpacket) 107int sendOffer(struct dhcpMessage *oldpacket)
@@ -114,14 +114,14 @@ int sendOffer(struct dhcpMessage *oldpacket)
114 struct in_addr addr; 114 struct in_addr addr;
115 115
116 init_packet(&packet, oldpacket, DHCPOFFER); 116 init_packet(&packet, oldpacket, DHCPOFFER);
117 117
118 /* ADDME: if static, short circuit */ 118 /* ADDME: if static, short circuit */
119 /* the client is in our lease/offered table */ 119 /* the client is in our lease/offered table */
120 if ((lease = find_lease_by_chaddr(oldpacket->chaddr))) { 120 if ((lease = find_lease_by_chaddr(oldpacket->chaddr))) {
121 if (!lease_expired(lease)) 121 if (!lease_expired(lease))
122 lease_time_align = lease->expires - time(0); 122 lease_time_align = lease->expires - time(0);
123 packet.yiaddr = lease->yiaddr; 123 packet.yiaddr = lease->yiaddr;
124 124
125 /* Or the client has a requested ip */ 125 /* Or the client has a requested ip */
126 } else if ((req = get_option(oldpacket, DHCP_REQUESTED_IP)) && 126 } else if ((req = get_option(oldpacket, DHCP_REQUESTED_IP)) &&
127 127
@@ -131,10 +131,10 @@ int sendOffer(struct dhcpMessage *oldpacket)
131 /* and the ip is in the lease range */ 131 /* and the ip is in the lease range */
132 ntohl(req_align) >= ntohl(server_config.start) && 132 ntohl(req_align) >= ntohl(server_config.start) &&
133 ntohl(req_align) <= ntohl(server_config.end) && 133 ntohl(req_align) <= ntohl(server_config.end) &&
134 134
135 /* and its not already taken/offered */ /* ADDME: check that its not a static lease */ 135 /* and its not already taken/offered */ /* ADDME: check that its not a static lease */
136 ((!(lease = find_lease_by_yiaddr(req_align)) || 136 ((!(lease = find_lease_by_yiaddr(req_align)) ||
137 137
138 /* or its taken, but expired */ /* ADDME: or maybe in here */ 138 /* or its taken, but expired */ /* ADDME: or maybe in here */
139 lease_expired(lease)))) { 139 lease_expired(lease)))) {
140 packet.yiaddr = req_align; /* FIXME: oh my, is there a host using this IP? */ 140 packet.yiaddr = req_align; /* FIXME: oh my, is there a host using this IP? */
@@ -142,32 +142,32 @@ int sendOffer(struct dhcpMessage *oldpacket)
142 /* otherwise, find a free IP */ /*ADDME: is it a static lease? */ 142 /* otherwise, find a free IP */ /*ADDME: is it a static lease? */
143 } else { 143 } else {
144 packet.yiaddr = find_address(0); 144 packet.yiaddr = find_address(0);
145 145
146 /* try for an expired lease */ 146 /* try for an expired lease */
147 if (!packet.yiaddr) packet.yiaddr = find_address(1); 147 if (!packet.yiaddr) packet.yiaddr = find_address(1);
148 } 148 }
149 149
150 if(!packet.yiaddr) { 150 if(!packet.yiaddr) {
151 LOG(LOG_WARNING, "no IP addresses to give -- OFFER abandoned"); 151 LOG(LOG_WARNING, "no IP addresses to give -- OFFER abandoned");
152 return -1; 152 return -1;
153 } 153 }
154 154
155 if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) { 155 if (!add_lease(packet.chaddr, packet.yiaddr, server_config.offer_time)) {
156 LOG(LOG_WARNING, "lease pool is full -- OFFER abandoned"); 156 LOG(LOG_WARNING, "lease pool is full -- OFFER abandoned");
157 return -1; 157 return -1;
158 } 158 }
159 159
160 if ((lease_time = get_option(oldpacket, DHCP_LEASE_TIME))) { 160 if ((lease_time = get_option(oldpacket, DHCP_LEASE_TIME))) {
161 memcpy(&lease_time_align, lease_time, 4); 161 memcpy(&lease_time_align, lease_time, 4);
162 lease_time_align = ntohl(lease_time_align); 162 lease_time_align = ntohl(lease_time_align);
163 if (lease_time_align > server_config.lease) 163 if (lease_time_align > server_config.lease)
164 lease_time_align = server_config.lease; 164 lease_time_align = server_config.lease;
165 } 165 }
166 166
167 /* Make sure we aren't just using the lease time from the previous offer */ 167 /* Make sure we aren't just using the lease time from the previous offer */
168 if (lease_time_align < server_config.min_lease) 168 if (lease_time_align < server_config.min_lease)
169 lease_time_align = server_config.lease; 169 lease_time_align = server_config.lease;
170 /* ADDME: end of short circuit */ 170 /* ADDME: end of short circuit */
171 add_simple_option(packet.options, DHCP_LEASE_TIME, htonl(lease_time_align)); 171 add_simple_option(packet.options, DHCP_LEASE_TIME, htonl(lease_time_align));
172 172
173 curr = server_config.options; 173 curr = server_config.options;
@@ -178,7 +178,7 @@ int sendOffer(struct dhcpMessage *oldpacket)
178 } 178 }
179 179
180 add_bootp_options(&packet); 180 add_bootp_options(&packet);
181 181
182 addr.s_addr = packet.yiaddr; 182 addr.s_addr = packet.yiaddr;
183 LOG(LOG_INFO, "sending OFFER of %s", inet_ntoa(addr)); 183 LOG(LOG_INFO, "sending OFFER of %s", inet_ntoa(addr));
184 return send_packet(&packet, 0); 184 return send_packet(&packet, 0);
@@ -190,7 +190,7 @@ int sendNAK(struct dhcpMessage *oldpacket)
190 struct dhcpMessage packet; 190 struct dhcpMessage packet;
191 191
192 init_packet(&packet, oldpacket, DHCPNAK); 192 init_packet(&packet, oldpacket, DHCPNAK);
193 193
194 DEBUG(LOG_INFO, "sending NAK"); 194 DEBUG(LOG_INFO, "sending NAK");
195 return send_packet(&packet, 1); 195 return send_packet(&packet, 1);
196} 196}
@@ -206,18 +206,18 @@ int sendACK(struct dhcpMessage *oldpacket, uint32_t yiaddr)
206 206
207 init_packet(&packet, oldpacket, DHCPACK); 207 init_packet(&packet, oldpacket, DHCPACK);
208 packet.yiaddr = yiaddr; 208 packet.yiaddr = yiaddr;
209 209
210 if ((lease_time = get_option(oldpacket, DHCP_LEASE_TIME))) { 210 if ((lease_time = get_option(oldpacket, DHCP_LEASE_TIME))) {
211 memcpy(&lease_time_align, lease_time, 4); 211 memcpy(&lease_time_align, lease_time, 4);
212 lease_time_align = ntohl(lease_time_align); 212 lease_time_align = ntohl(lease_time_align);
213 if (lease_time_align > server_config.lease) 213 if (lease_time_align > server_config.lease)
214 lease_time_align = server_config.lease; 214 lease_time_align = server_config.lease;
215 else if (lease_time_align < server_config.min_lease) 215 else if (lease_time_align < server_config.min_lease)
216 lease_time_align = server_config.lease; 216 lease_time_align = server_config.lease;
217 } 217 }
218 218
219 add_simple_option(packet.options, DHCP_LEASE_TIME, htonl(lease_time_align)); 219 add_simple_option(packet.options, DHCP_LEASE_TIME, htonl(lease_time_align));
220 220
221 curr = server_config.options; 221 curr = server_config.options;
222 while (curr) { 222 while (curr) {
223 if (curr->data[OPT_CODE] != DHCP_LEASE_TIME) 223 if (curr->data[OPT_CODE] != DHCP_LEASE_TIME)
@@ -230,7 +230,7 @@ int sendACK(struct dhcpMessage *oldpacket, uint32_t yiaddr)
230 addr.s_addr = packet.yiaddr; 230 addr.s_addr = packet.yiaddr;
231 LOG(LOG_INFO, "sending ACK to %s", inet_ntoa(addr)); 231 LOG(LOG_INFO, "sending ACK to %s", inet_ntoa(addr));
232 232
233 if (send_packet(&packet, 0) < 0) 233 if (send_packet(&packet, 0) < 0)
234 return -1; 234 return -1;
235 235
236 add_lease(packet.chaddr, packet.yiaddr, lease_time_align); 236 add_lease(packet.chaddr, packet.yiaddr, lease_time_align);
@@ -245,7 +245,7 @@ int send_inform(struct dhcpMessage *oldpacket)
245 struct option_set *curr; 245 struct option_set *curr;
246 246
247 init_packet(&packet, oldpacket, DHCPACK); 247 init_packet(&packet, oldpacket, DHCPACK);
248 248
249 curr = server_config.options; 249 curr = server_config.options;
250 while (curr) { 250 while (curr) {
251 if (curr->data[OPT_CODE] != DHCP_LEASE_TIME) 251 if (curr->data[OPT_CODE] != DHCP_LEASE_TIME)
diff --git a/networking/udhcp/socket.c b/networking/udhcp/socket.c
index 582f0fce5..7b057523a 100644
--- a/networking/udhcp/socket.c
+++ b/networking/udhcp/socket.c
@@ -55,7 +55,7 @@ int read_interface(char *interface, int *ifindex, uint32_t *addr, uint8_t *arp)
55 ifr.ifr_addr.sa_family = AF_INET; 55 ifr.ifr_addr.sa_family = AF_INET;
56 strcpy(ifr.ifr_name, interface); 56 strcpy(ifr.ifr_name, interface);
57 57
58 if (addr) { 58 if (addr) {
59 if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) { 59 if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) {
60 our_ip = (struct sockaddr_in *) &ifr.ifr_addr; 60 our_ip = (struct sockaddr_in *) &ifr.ifr_addr;
61 *addr = our_ip->sin_addr.s_addr; 61 *addr = our_ip->sin_addr.s_addr;
@@ -65,7 +65,7 @@ int read_interface(char *interface, int *ifindex, uint32_t *addr, uint8_t *arp)
65 return -1; 65 return -1;
66 } 66 }
67 } 67 }
68 68
69 if (ioctl(fd, SIOCGIFINDEX, &ifr) == 0) { 69 if (ioctl(fd, SIOCGIFINDEX, &ifr) == 0) {
70 DEBUG(LOG_INFO, "adapter index %d", ifr.ifr_ifindex); 70 DEBUG(LOG_INFO, "adapter index %d", ifr.ifr_ifindex);
71 *ifindex = ifr.ifr_ifindex; 71 *ifindex = ifr.ifr_ifindex;
@@ -102,7 +102,7 @@ int listen_socket(uint32_t ip, int port, char *inf)
102 DEBUG(LOG_ERR, "socket call failed: %m"); 102 DEBUG(LOG_ERR, "socket call failed: %m");
103 return -1; 103 return -1;
104 } 104 }
105 105
106 memset(&addr, 0, sizeof(addr)); 106 memset(&addr, 0, sizeof(addr));
107 addr.sin_family = AF_INET; 107 addr.sin_family = AF_INET;
108 addr.sin_port = htons(port); 108 addr.sin_port = htons(port);
@@ -127,6 +127,6 @@ int listen_socket(uint32_t ip, int port, char *inf)
127 close(fd); 127 close(fd);
128 return -1; 128 return -1;
129 } 129 }
130 130
131 return fd; 131 return fd;
132} 132}
diff --git a/networking/vconfig.c b/networking/vconfig.c
index 0bb33084a..bbd29873c 100644
--- a/networking/vconfig.c
+++ b/networking/vconfig.c
@@ -63,7 +63,7 @@ struct vlan_ioctl_args {
63 unsigned int flag; /* Matches vlan_dev_info flags */ 63 unsigned int flag; /* Matches vlan_dev_info flags */
64 } u; 64 } u;
65 65
66 short vlan_qos; 66 short vlan_qos;
67}; 67};
68 68
69#define VLAN_GROUP_ARRAY_LEN 4096 69#define VLAN_GROUP_ARRAY_LEN 4096
@@ -110,7 +110,7 @@ static const char name_types[] = {
110 '_', 'P', 'L', 'U', 'S', '_', 'V', 'I', 'D', 110 '_', 'P', 'L', 'U', 'S', '_', 'V', 'I', 'D',
111 0, 111 0,
112 VLAN_NAME_TYPE_PLUS_VID_NO_PAD, 22, 112 VLAN_NAME_TYPE_PLUS_VID_NO_PAD, 22,
113 'V', 'L', 'A', 'N', 113 'V', 'L', 'A', 'N',
114 '_', 'P', 'L', 'U', 'S', '_', 'V', 'I', 'D', 114 '_', 'P', 'L', 'U', 'S', '_', 'V', 'I', 'D',
115 '_', 'N', 'O', '_', 'P', 'A', 'D', 0, 115 '_', 'N', 'O', '_', 'P', 'A', 'D', 0,
116 VLAN_NAME_TYPE_RAW_PLUS_VID, 15, 116 VLAN_NAME_TYPE_RAW_PLUS_VID, 15,
diff --git a/networking/wget.c b/networking/wget.c
index cb0790ea7..619c138ba 100644
--- a/networking/wget.c
+++ b/networking/wget.c
@@ -55,7 +55,7 @@ static volatile unsigned long statbytes = 0; /* Number of bytes transferred so f
55/* For progressmeter() -- number of seconds before xfer considered "stalled" */ 55/* For progressmeter() -- number of seconds before xfer considered "stalled" */
56static const int STALLTIME = 5; 56static const int STALLTIME = 5;
57#endif 57#endif
58 58
59static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue) 59static void close_and_delete_outfile(FILE* output, char *fname_out, int do_continue)
60{ 60{
61 if (output != stdout && do_continue==0) { 61 if (output != stdout && do_continue==0) {
@@ -236,18 +236,18 @@ int wget_main(int argc, char **argv)
236 use_proxy = 0; 236 use_proxy = 0;
237 } 237 }
238 } 238 }
239 239
240 /* Guess an output filename */ 240 /* Guess an output filename */
241 if (!fname_out) { 241 if (!fname_out) {
242 fname_out = 242 fname_out =
243#ifdef CONFIG_FEATURE_WGET_STATUSBAR 243#ifdef CONFIG_FEATURE_WGET_STATUSBAR
244 curfile = 244 curfile =
245#endif 245#endif
246 bb_get_last_path_component(target.path); 246 bb_get_last_path_component(target.path);
247 if (fname_out==NULL || strlen(fname_out)<1) { 247 if (fname_out==NULL || strlen(fname_out)<1) {
248 fname_out = 248 fname_out =
249#ifdef CONFIG_FEATURE_WGET_STATUSBAR 249#ifdef CONFIG_FEATURE_WGET_STATUSBAR
250 curfile = 250 curfile =
251#endif 251#endif
252 "index.html"; 252 "index.html";
253 } 253 }
@@ -309,7 +309,7 @@ int wget_main(int argc, char **argv)
309 */ 309 */
310 if (sfp) fclose(sfp); 310 if (sfp) fclose(sfp);
311 sfp = open_socket(&s_in); 311 sfp = open_socket(&s_in);
312 312
313 /* 313 /*
314 * Send HTTP request. 314 * Send HTTP request.
315 */ 315 */
@@ -351,7 +351,7 @@ int wget_main(int argc, char **argv)
351read_response: 351read_response:
352 if (fgets(buf, sizeof(buf), sfp) == NULL) 352 if (fgets(buf, sizeof(buf), sfp) == NULL)
353 close_delete_and_die("no response from server"); 353 close_delete_and_die("no response from server");
354 354
355 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s) 355 for (s = buf ; *s != '\0' && !isspace(*s) ; ++s)
356 ; 356 ;
357 for ( ; isspace(*s) ; ++s) 357 for ( ; isspace(*s) ; ++s)
@@ -379,7 +379,7 @@ read_response:
379 chomp(buf); 379 chomp(buf);
380 close_delete_and_die("server returned error %d: %s", atoi(s), buf); 380 close_delete_and_die("server returned error %d: %s", atoi(s), buf);
381 } 381 }
382 382
383 /* 383 /*
384 * Retrieve HTTP headers. 384 * Retrieve HTTP headers.
385 */ 385 */
@@ -416,7 +416,7 @@ read_response:
416 } 416 }
417 } 417 }
418 } while(status >= 300); 418 } while(status >= 300);
419 419
420 dfp = sfp; 420 dfp = sfp;
421 } 421 }
422 else 422 else
@@ -431,7 +431,7 @@ read_response:
431 if (ftpcmd(NULL, NULL, sfp, buf) != 220) 431 if (ftpcmd(NULL, NULL, sfp, buf) != 220)
432 close_delete_and_die("%s", buf+4); 432 close_delete_and_die("%s", buf+4);
433 433
434 /* 434 /*
435 * Splitting username:password pair, 435 * Splitting username:password pair,
436 * trying to log in 436 * trying to log in
437 */ 437 */
@@ -448,10 +448,10 @@ read_response:
448 default: 448 default:
449 close_delete_and_die("ftp login: %s", buf+4); 449 close_delete_and_die("ftp login: %s", buf+4);
450 } 450 }
451 451
452 ftpcmd("CDUP", NULL, sfp, buf); 452 ftpcmd("CDUP", NULL, sfp, buf);
453 ftpcmd("TYPE I", NULL, sfp, buf); 453 ftpcmd("TYPE I", NULL, sfp, buf);
454 454
455 /* 455 /*
456 * Querying file size 456 * Querying file size
457 */ 457 */
@@ -463,7 +463,7 @@ read_response:
463 filesize = value; 463 filesize = value;
464 got_clen = 1; 464 got_clen = 1;
465 } 465 }
466 466
467 /* 467 /*
468 * Entering passive mode 468 * Entering passive mode
469 */ 469 */
@@ -486,7 +486,7 @@ read_response:
486 } else 486 } else
487 filesize -= beg_range; 487 filesize -= beg_range;
488 } 488 }
489 489
490 if (ftpcmd("RETR /", target.path, sfp, buf) > 150) 490 if (ftpcmd("RETR /", target.path, sfp, buf) > 150)
491 close_delete_and_die("RETR: %s", buf+4); 491 close_delete_and_die("RETR: %s", buf+4);
492 492
@@ -661,27 +661,27 @@ char *gethdr(char *buf, size_t bufsiz, FILE *fp, int *istrunc)
661static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf) 661static int ftpcmd(char *s1, char *s2, FILE *fp, char *buf)
662{ 662{
663 char *p; 663 char *p;
664 664
665 if (s1) { 665 if (s1) {
666 if (!s2) s2=""; 666 if (!s2) s2="";
667 fprintf(fp, "%s%s\r\n", s1, s2); 667 fprintf(fp, "%s%s\r\n", s1, s2);
668 fflush(fp); 668 fflush(fp);
669 } 669 }
670 670
671 do { 671 do {
672 p = fgets(buf, 510, fp); 672 p = fgets(buf, 510, fp);
673 if (!p) 673 if (!p)
674 bb_perror_msg_and_die("fgets()"); 674 bb_perror_msg_and_die("fgets()");
675 } while (! isdigit(buf[0]) || buf[3] != ' '); 675 } while (! isdigit(buf[0]) || buf[3] != ' ');
676 676
677 return atoi(buf); 677 return atoi(buf);
678} 678}
679 679
680#ifdef CONFIG_FEATURE_WGET_STATUSBAR 680#ifdef CONFIG_FEATURE_WGET_STATUSBAR
681/* Stuff below is from BSD rcp util.c, as added to openshh. 681/* Stuff below is from BSD rcp util.c, as added to openshh.
682 * Original copyright notice is retained at the end of this file. 682 * Original copyright notice is retained at the end of this file.
683 * 683 *
684 */ 684 */
685 685
686 686
687static int 687static int
@@ -813,7 +813,7 @@ progressmeter(int flag)
813 813
814/* Original copyright notice which applies to the CONFIG_FEATURE_WGET_STATUSBAR stuff, 814/* Original copyright notice which applies to the CONFIG_FEATURE_WGET_STATUSBAR stuff,
815 * much of which was blatently stolen from openssh. */ 815 * much of which was blatently stolen from openssh. */
816 816
817/*- 817/*-
818 * Copyright (c) 1992, 1993 818 * Copyright (c) 1992, 1993
819 * The Regents of the University of California. All rights reserved. 819 * The Regents of the University of California. All rights reserved.
@@ -827,8 +827,8 @@ progressmeter(int flag)
827 * notice, this list of conditions and the following disclaimer in the 827 * notice, this list of conditions and the following disclaimer in the
828 * documentation and/or other materials provided with the distribution. 828 * documentation and/or other materials provided with the distribution.
829 * 829 *
830 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 830 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
831 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 831 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
832 * 832 *
833 * 4. Neither the name of the University nor the names of its contributors 833 * 4. Neither the name of the University nor the names of its contributors
834 * may be used to endorse or promote products derived from this software 834 * may be used to endorse or promote products derived from this software
@@ -846,7 +846,7 @@ progressmeter(int flag)
846 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 846 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
847 * SUCH DAMAGE. 847 * SUCH DAMAGE.
848 * 848 *
849 * $Id: wget.c,v 1.70 2004/03/06 22:11:44 andersen Exp $ 849 * $Id: wget.c,v 1.71 2004/03/15 08:28:53 andersen Exp $
850 */ 850 */
851 851
852 852
diff --git a/patches/eject.diff b/patches/eject.diff
index 3efd449c0..fcc234d02 100644
--- a/patches/eject.diff
+++ b/patches/eject.diff
@@ -6,15 +6,15 @@ diff -u -r1.40 AUTHORS
6--- a/AUTHORS 9 Oct 2003 21:19:21 -0000 1.40 6--- a/AUTHORS 9 Oct 2003 21:19:21 -0000 1.40
7+++ b/AUTHORS 5 Mar 2004 07:23:17 -0000 7+++ b/AUTHORS 5 Mar 2004 07:23:17 -0000
8@@ -8,6 +8,9 @@ 8@@ -8,6 +8,9 @@
9 9
10 ----------- 10 -----------
11 11
12+Peter Willis <psyphreak@phreaker.net> 12+Peter Willis <psyphreak@phreaker.net>
13+ eject 13+ eject
14+ 14+
15 Emanuele Aina <emanuele.aina@tiscali.it> 15 Emanuele Aina <emanuele.aina@tiscali.it>
16 run-parts 16 run-parts
17 17
18Index: coreutils/Config.in 18Index: coreutils/Config.in
19=================================================================== 19===================================================================
20RCS file: /var/cvs/busybox/coreutils/Config.in,v 20RCS file: /var/cvs/busybox/coreutils/Config.in,v
@@ -25,7 +25,7 @@ diff -u -r1.23 Config.in
25@@ -164,6 +164,13 @@ 25@@ -164,6 +164,13 @@
26 a command; without options it displays the current 26 a command; without options it displays the current
27 environment. 27 environment.
28 28
29+config CONFIG_EJECT 29+config CONFIG_EJECT
30+ bool "eject" 30+ bool "eject"
31+ default n 31+ default n
@@ -151,7 +151,7 @@ diff -u -r1.191 usage.h
151@@ -537,6 +537,13 @@ 151@@ -537,6 +537,13 @@
152 "\t-, -i\tstart with an empty environment\n" \ 152 "\t-, -i\tstart with an empty environment\n" \
153 "\t-u\tremove variable from the environment\n" 153 "\t-u\tremove variable from the environment\n"
154 154
155+#define eject_trivial_usage \ 155+#define eject_trivial_usage \
156+ "[-t] [FILE]" 156+ "[-t] [FILE]"
157+#define eject_full_usage \ 157+#define eject_full_usage \
diff --git a/patches/tftp_timeout_multicast.diff b/patches/tftp_timeout_multicast.diff
index a76a18c61..0f09d4a04 100644
--- a/patches/tftp_timeout_multicast.diff
+++ b/patches/tftp_timeout_multicast.diff
@@ -6,15 +6,15 @@ diff -u -r1.40 AUTHORS
6--- a/AUTHORS 9 Oct 2003 21:19:21 -0000 1.40 6--- a/AUTHORS 9 Oct 2003 21:19:21 -0000 1.40
7+++ b/AUTHORS 5 Mar 2004 15:45:47 -0000 7+++ b/AUTHORS 5 Mar 2004 15:45:47 -0000
8@@ -92,6 +92,9 @@ 8@@ -92,6 +92,9 @@
9 Original author of BusyBox in 1995, 1996. Some of his code can 9 Original author of BusyBox in 1995, 1996. Some of his code can
10 still be found hiding here and there... 10 still be found hiding here and there...
11 11
12+John Powers <jpp@ti.com> 12+John Powers <jpp@ti.com>
13+ Added multicast option (rfc2090) and timeout option (rfc2349) to tftp. 13+ Added multicast option (rfc2090) and timeout option (rfc2349) to tftp.
14+ 14+
15 Tim Riker <Tim@Rikers.org> 15 Tim Riker <Tim@Rikers.org>
16 bug fixes, member of fan club 16 bug fixes, member of fan club
17 17
18Index: include/usage.h 18Index: include/usage.h
19=================================================================== 19===================================================================
20RCS file: /var/cvs/busybox/include/usage.h,v 20RCS file: /var/cvs/busybox/include/usage.h,v
@@ -41,7 +41,7 @@ diff -u -r1.191 usage.h
41+#else 41+#else
42+ #define USAGE_TFTP_DEBUG(a) 42+ #define USAGE_TFTP_DEBUG(a)
43+#endif 43+#endif
44 44
45 #define tftp_trivial_usage \ 45 #define tftp_trivial_usage \
46 "[OPTION]... HOST [PORT]" 46 "[OPTION]... HOST [PORT]"
47@@ -2508,6 +2523,16 @@ 47@@ -2508,6 +2523,16 @@
@@ -71,7 +71,7 @@ diff -u -r1.27 Config.in
71@@ -522,6 +522,13 @@ 71@@ -522,6 +522,13 @@
72 Add support for the GET command within the TFTP client. This allows 72 Add support for the GET command within the TFTP client. This allows
73 a client to retrieve a file from a TFTP server. 73 a client to retrieve a file from a TFTP server.
74 74
75+config CONFIG_FEATURE_TFTP_MULTICAST 75+config CONFIG_FEATURE_TFTP_MULTICAST
76+ bool " Enable \"multicast\" option" 76+ bool " Enable \"multicast\" option"
77+ default n 77+ default n
@@ -84,7 +84,7 @@ diff -u -r1.27 Config.in
84 default y 84 default y
85@@ -531,12 +538,19 @@ 85@@ -531,12 +538,19 @@
86 a client to transfer a file to a TFTP server. 86 a client to transfer a file to a TFTP server.
87 87
88 config CONFIG_FEATURE_TFTP_BLOCKSIZE 88 config CONFIG_FEATURE_TFTP_BLOCKSIZE
89- bool " Enable \"blocksize\" command" 89- bool " Enable \"blocksize\" command"
90+ bool " Enable \"blksize\" option" 90+ bool " Enable \"blksize\" option"
@@ -92,7 +92,7 @@ diff -u -r1.27 Config.in
92 depends on CONFIG_TFTP 92 depends on CONFIG_TFTP
93 help 93 help
94 Allow the client to specify the desired block size for transfers. 94 Allow the client to specify the desired block size for transfers.
95 95
96+config CONFIG_FEATURE_TFTP_TIMEOUT 96+config CONFIG_FEATURE_TFTP_TIMEOUT
97+ bool " Enable \"timeout\" option" 97+ bool " Enable \"timeout\" option"
98+ default n 98+ default n
@@ -138,15 +138,15 @@ diff -u -r1.25 tftp.c
138 /* */ 138 /* */
139 /* Parts of the code based on: */ 139 /* Parts of the code based on: */
140@@ -46,8 +61,20 @@ 140@@ -46,8 +61,20 @@
141 141
142 #include "busybox.h" 142 #include "busybox.h"
143 143
144+#if defined(CONFIG_FEATURE_TFTP_BLOCKSIZE) || defined(CONFIG_FEATURE_TFTP_MULTICAST) || defined(CONFIG_FEATURE_TFTP_TIMEOUT) 144+#if defined(CONFIG_FEATURE_TFTP_BLOCKSIZE) || defined(CONFIG_FEATURE_TFTP_MULTICAST) || defined(CONFIG_FEATURE_TFTP_TIMEOUT)
145+ #define TFTP_OPTIONS 145+ #define TFTP_OPTIONS
146+#endif 146+#endif
147+ 147+
148 //#define CONFIG_FEATURE_TFTP_DEBUG 148 //#define CONFIG_FEATURE_TFTP_DEBUG
149 149
150+#ifdef CONFIG_FEATURE_TFTP_DEBUG 150+#ifdef CONFIG_FEATURE_TFTP_DEBUG
151+ static void printtime(void); 151+ static void printtime(void);
152+ #define dprintf(fmt...) if (debug) {printtime(); printf(fmt);} 152+ #define dprintf(fmt...) if (debug) {printtime(); printf(fmt);}
@@ -157,7 +157,7 @@ diff -u -r1.25 tftp.c
157+ 157+
158 #define TFTP_BLOCKSIZE_DEFAULT 512 /* according to RFC 1350, don't change */ 158 #define TFTP_BLOCKSIZE_DEFAULT 512 /* according to RFC 1350, don't change */
159 #define TFTP_TIMEOUT 5 /* seconds */ 159 #define TFTP_TIMEOUT 5 /* seconds */
160 160
161@@ -68,12 +95,24 @@ 161@@ -68,12 +95,24 @@
162 "Illegal TFTP operation", 162 "Illegal TFTP operation",
163 "Unknown transfer ID", 163 "Unknown transfer ID",
@@ -168,10 +168,10 @@ diff -u -r1.25 tftp.c
168+ "Unsupported option", 168+ "Unsupported option",
169+#endif 169+#endif
170 }; 170 };
171 171
172 const int tftp_cmd_get = 1; 172 const int tftp_cmd_get = 1;
173 const int tftp_cmd_put = 2; 173 const int tftp_cmd_put = 2;
174 174
175+ 175+
176+struct tftp_option { 176+struct tftp_option {
177+ int multicast; 177+ int multicast;
@@ -182,12 +182,12 @@ diff -u -r1.25 tftp.c
182+ 182+
183+ 183+
184 #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE 184 #ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
185 185
186 static int tftp_blocksize_check(int blocksize, int bufsize) 186 static int tftp_blocksize_check(int blocksize, int bufsize)
187@@ -93,16 +132,158 @@ 187@@ -93,16 +132,158 @@
188 return blocksize; 188 return blocksize;
189 } 189 }
190 190
191+#endif 191+#endif
192+ 192+
193+#ifdef CONFIG_FEATURE_TFTP_TIMEOUT 193+#ifdef CONFIG_FEATURE_TFTP_TIMEOUT
@@ -332,15 +332,15 @@ diff -u -r1.25 tftp.c
332+ 332+
333+#ifdef TFTP_OPTIONS 333+#ifdef TFTP_OPTIONS
334+ 334+
335 static char *tftp_option_get(char *buf, int len, char *option) 335 static char *tftp_option_get(char *buf, int len, char *option)
336 { 336 {
337- int opt_val = 0; 337- int opt_val = 0;
338+ int opt_val = 0; 338+ int opt_val = 0;
339 int opt_found = 0; 339 int opt_found = 0;
340 int k; 340 int k;
341- 341-
342- while (len > 0) { 342- while (len > 0) {
343 343
344+ while (len > 0) { 344+ while (len > 0) {
345 /* Make sure the options are terminated correctly */ 345 /* Make sure the options are terminated correctly */
346- 346-
@@ -351,7 +351,7 @@ diff -u -r1.25 tftp.c
351 if (strcasecmp(buf, option) == 0) { 351 if (strcasecmp(buf, option) == 0) {
352 opt_found = 1; 352 opt_found = 1;
353 } 353 }
354- } 354- }
355- else { 355- else {
356- if (opt_found) { 356- if (opt_found) {
357+ } else { 357+ } else {
@@ -361,7 +361,7 @@ diff -u -r1.25 tftp.c
361 } 361 }
362@@ -138,7 +318,8 @@ 362@@ -138,7 +318,8 @@
363 #endif 363 #endif
364 364
365 static inline int tftp(const int cmd, const struct hostent *host, 365 static inline int tftp(const int cmd, const struct hostent *host,
366- const char *remotefile, int localfd, const unsigned short port, int tftp_bufsize) 366- const char *remotefile, int localfd, const unsigned short port, int tftp_bufsize)
367+ const char *remotefile, int localfd, const unsigned short port, 367+ const char *remotefile, int localfd, const unsigned short port,
@@ -376,7 +376,7 @@ diff -u -r1.25 tftp.c
376- int timeout = bb_tftp_num_retries; 376- int timeout = bb_tftp_num_retries;
377+ int retry = bb_tftp_num_retries; 377+ int retry = bb_tftp_num_retries;
378 unsigned short block_nr = 1; 378 unsigned short block_nr = 1;
379 379
380-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE 380-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
381- int want_option_ack = 0; 381- int want_option_ack = 0;
382+#ifdef CONFIG_FEATURE_TFTP_MULTICAST 382+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
@@ -393,21 +393,21 @@ diff -u -r1.25 tftp.c
393+ #define master_client 1 393+ #define master_client 1
394+ #define ack_oack 0 394+ #define ack_oack 0
395 #endif 395 #endif
396 396
397 /* Can't use RESERVE_CONFIG_BUFFER here since the allocation 397 /* Can't use RESERVE_CONFIG_BUFFER here since the allocation
398 * size varies meaning BUFFERS_GO_ON_STACK would fail */ 398 * size varies meaning BUFFERS_GO_ON_STACK would fail */
399- char *buf=xmalloc(tftp_bufsize + 4); 399- char *buf=xmalloc(tftp_bufsize + 4);
400+ char *buf=xmalloc(option->blksize + 4); 400+ char *buf=xmalloc(option->blksize + 4);
401 401
402- tftp_bufsize += 4; 402- tftp_bufsize += 4;
403+ int tftp_bufsize = option->blksize + 4; 403+ int tftp_bufsize = option->blksize + 4;
404 404
405 if ((socketfd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) { 405 if ((socketfd = socket(PF_INET, SOCK_DGRAM, 0)) < 0) {
406 bb_perror_msg("socket"); 406 bb_perror_msg("socket");
407@@ -183,15 +375,21 @@ 407@@ -183,15 +375,21 @@
408 memcpy(&sa.sin_addr, (struct in_addr *) host->h_addr, 408 memcpy(&sa.sin_addr, (struct in_addr *) host->h_addr,
409 sizeof(sa.sin_addr)); 409 sizeof(sa.sin_addr));
410 410
411- /* build opcode */ 411- /* build opcode */
412- 412-
413- if (cmd_get) { 413- if (cmd_get) {
@@ -423,48 +423,48 @@ diff -u -r1.25 tftp.c
423+ memset(mcblockmap, 0, bmsize+1); 423+ memset(mcblockmap, 0, bmsize+1);
424 } 424 }
425+#endif 425+#endif
426 426
427- if (cmd_put) { 427- if (cmd_put) {
428- opcode = TFTP_WRQ; 428- opcode = TFTP_WRQ;
429- } 429- }
430+ /* build opcode */ 430+ /* build opcode */
431+ 431+
432+ opcode = cmd_get ? TFTP_RRQ : TFTP_WRQ; 432+ opcode = cmd_get ? TFTP_RRQ : TFTP_WRQ;
433 433
434 while (1) { 434 while (1) {
435 435
436@@ -203,7 +401,7 @@ 436@@ -203,7 +401,7 @@
437 437
438 cp += 2; 438 cp += 2;
439 439
440- /* add filename and mode */ 440- /* add filename and mode */
441+ /* First packet of file transfer includes file name, mode, and options */ 441+ /* First packet of file transfer includes file name, mode, and options */
442 442
443 if ((cmd_get && (opcode == TFTP_RRQ)) || 443 if ((cmd_get && (opcode == TFTP_RRQ)) ||
444 (cmd_put && (opcode == TFTP_WRQ))) { 444 (cmd_put && (opcode == TFTP_WRQ))) {
445@@ -223,7 +421,7 @@ 445@@ -223,7 +421,7 @@
446 } 446 }
447 447
448 if (too_long || ((&buf[tftp_bufsize - 1] - cp) < 6)) { 448 if (too_long || ((&buf[tftp_bufsize - 1] - cp) < 6)) {
449- bb_error_msg("too long remote-filename"); 449- bb_error_msg("too long remote-filename");
450+ bb_error_msg("too long: remote filename"); 450+ bb_error_msg("too long: remote filename");
451 break; 451 break;
452 } 452 }
453 453
454@@ -238,8 +436,8 @@ 454@@ -238,8 +436,8 @@
455 455
456 if (len != TFTP_BLOCKSIZE_DEFAULT) { 456 if (len != TFTP_BLOCKSIZE_DEFAULT) {
457 457
458- if ((&buf[tftp_bufsize - 1] - cp) < 15) { 458- if ((&buf[tftp_bufsize - 1] - cp) < 15) {
459- bb_error_msg("too long remote-filename"); 459- bb_error_msg("too long remote-filename");
460+ if ((&buf[tftp_bufsize - 1] - cp) < 15) { 460+ if ((&buf[tftp_bufsize - 1] - cp) < 15) {
461+ bb_error_msg("buffer too small for blksize option"); 461+ bb_error_msg("buffer too small for blksize option");
462 break; 462 break;
463 } 463 }
464 464
465@@ -249,16 +447,65 @@ 465@@ -249,16 +447,65 @@
466 cp += 8; 466 cp += 8;
467 467
468 cp += snprintf(cp, 6, "%d", len) + 1; 468 cp += snprintf(cp, 6, "%d", len) + 1;
469+ } 469+ }
470+#endif 470+#endif
@@ -480,7 +480,7 @@ diff -u -r1.25 tftp.c
480+ } 480+ }
481+ 481+
482+ /* add "multicast" option */ 482+ /* add "multicast" option */
483 483
484- want_option_ack = 1; 484- want_option_ack = 1;
485+ memcpy(cp, "multicast\0", 11); 485+ memcpy(cp, "multicast\0", 11);
486+ cp += 11; 486+ cp += 11;
@@ -509,9 +509,9 @@ diff -u -r1.25 tftp.c
509+#endif 509+#endif
510+ 510+
511 } 511 }
512 512
513 /* add ack and data */ 513 /* add ack and data */
514 514
515- if ((cmd_get && (opcode == TFTP_ACK)) || 515- if ((cmd_get && (opcode == TFTP_ACK)) ||
516- (cmd_put && (opcode == TFTP_DATA))) { 516- (cmd_put && (opcode == TFTP_DATA))) {
517+#ifdef CONFIG_FEATURE_TFTP_MULTICAST 517+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
@@ -528,33 +528,33 @@ diff -u -r1.25 tftp.c
528+#endif 528+#endif
529+ else if ((cmd_get && opcode == TFTP_ACK) || 529+ else if ((cmd_get && opcode == TFTP_ACK) ||
530+ (cmd_put && opcode == TFTP_DATA)) { 530+ (cmd_put && opcode == TFTP_DATA)) {
531 531
532 *((unsigned short *) cp) = htons(block_nr); 532 *((unsigned short *) cp) = htons(block_nr);
533 533
534@@ -275,7 +522,7 @@ 534@@ -275,7 +522,7 @@
535 } 535 }
536 536
537 if (len != (tftp_bufsize - 4)) { 537 if (len != (tftp_bufsize - 4)) {
538- finished++; 538- finished++;
539+ finished = 1; 539+ finished = 1;
540 } 540 }
541 541
542 cp += len; 542 cp += len;
543@@ -283,82 +530,119 @@ 543@@ -283,82 +530,119 @@
544 } 544 }
545 545
546 546
547- /* send packet */ 547- /* send packet */
548+ /* send packet and receive reply */ 548+ /* send packet and receive reply */
549 549
550 550
551- timeout = bb_tftp_num_retries; /* re-initialize */ 551- timeout = bb_tftp_num_retries; /* re-initialize */
552+ retry = bb_tftp_num_retries; /* re-initialize */ 552+ retry = bb_tftp_num_retries; /* re-initialize */
553 do { 553 do {
554- 554-
555+ int selectrc; 555+ int selectrc;
556 len = cp - buf; 556 len = cp - buf;
557 557
558-#ifdef CONFIG_FEATURE_TFTP_DEBUG 558-#ifdef CONFIG_FEATURE_TFTP_DEBUG
559- fprintf(stderr, "sending %u bytes\n", len); 559- fprintf(stderr, "sending %u bytes\n", len);
560- for (cp = buf; cp < &buf[len]; cp++) 560- for (cp = buf; cp < &buf[len]; cp++)
@@ -570,7 +570,7 @@ diff -u -r1.25 tftp.c
570- 570-
571+ /* send packet */ 571+ /* send packet */
572+ if ((len > 2) && (! option->multicast || master_client || ack_oack)) { 572+ if ((len > 2) && (! option->multicast || master_client || ack_oack)) {
573 573
574- if (finished && (opcode == TFTP_ACK)) { 574- if (finished && (opcode == TFTP_ACK)) {
575- break; 575- break;
576+#ifdef CONFIG_FEATURE_TFTP_DEBUG 576+#ifdef CONFIG_FEATURE_TFTP_DEBUG
@@ -593,17 +593,17 @@ diff -u -r1.25 tftp.c
593+ break; 593+ break;
594+ } 594+ }
595 } 595 }
596 596
597- /* receive packet */ 597- /* receive packet */
598+ /* receive reply packet */ 598+ /* receive reply packet */
599 599
600 memset(&from, 0, sizeof(from)); 600 memset(&from, 0, sizeof(from));
601 fromlen = sizeof(from); 601 fromlen = sizeof(from);
602 602
603- tv.tv_sec = TFTP_TIMEOUT; 603- tv.tv_sec = TFTP_TIMEOUT;
604+ tv.tv_sec = option->client_timeout; 604+ tv.tv_sec = option->client_timeout;
605 tv.tv_usec = 0; 605 tv.tv_usec = 0;
606 606
607 FD_ZERO(&rfds); 607 FD_ZERO(&rfds);
608 FD_SET(socketfd, &rfds); 608 FD_SET(socketfd, &rfds);
609+ dprintf("set to receive from socketfd (%d)\n", socketfd); 609+ dprintf("set to receive from socketfd (%d)\n", socketfd);
@@ -613,7 +613,7 @@ diff -u -r1.25 tftp.c
613+ dprintf("set to receive from mcfd (%d)\n", mcfd); 613+ dprintf("set to receive from mcfd (%d)\n", mcfd);
614+ } 614+ }
615+#endif 615+#endif
616 616
617- switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) { 617- switch (select(FD_SETSIZE, &rfds, NULL, NULL, &tv)) {
618- case 1: 618- case 1:
619- len = recvfrom(socketfd, buf, tftp_bufsize, 0, 619- len = recvfrom(socketfd, buf, tftp_bufsize, 0,
@@ -646,7 +646,7 @@ diff -u -r1.25 tftp.c
646+ } 646+ }
647+ } 647+ }
648 } 648 }
649 649
650- timeout = 0; 650- timeout = 0;
651- 651-
652- if (sa.sin_port == port) { 652- if (sa.sin_port == port) {
@@ -677,13 +677,13 @@ diff -u -r1.25 tftp.c
677- /* discard the packet - treat as timeout */ 677- /* discard the packet - treat as timeout */
678- timeout = bb_tftp_num_retries; 678- timeout = bb_tftp_num_retries;
679+#endif 679+#endif
680 680
681- case 0: 681- case 0:
682+ } else if (selectrc == 0) { 682+ } else if (selectrc == 0) {
683+ /* Time out */ 683+ /* Time out */
684+ dprintf("timeout\n"); 684+ dprintf("timeout\n");
685 bb_error_msg("timeout"); 685 bb_error_msg("timeout");
686 686
687- timeout--; 687- timeout--;
688- if (timeout == 0) { 688- if (timeout == 0) {
689+ retry--; 689+ retry--;
@@ -700,59 +700,59 @@ diff -u -r1.25 tftp.c
700 bb_perror_msg("select"); 700 bb_perror_msg("select");
701 len = -1; 701 len = -1;
702 } 702 }
703 703
704- } while (timeout && (len >= 0)); 704- } while (timeout && (len >= 0));
705+ } while (retry && len >= 0); 705+ } while (retry && len >= 0);
706 706
707 if ((finished) || (len < 0)) { 707 if ((finished) || (len < 0)) {
708 break; 708 break;
709@@ -370,9 +654,8 @@ 709@@ -370,9 +654,8 @@
710 opcode = ntohs(*((unsigned short *) buf)); 710 opcode = ntohs(*((unsigned short *) buf));
711 tmp = ntohs(*((unsigned short *) &buf[2])); 711 tmp = ntohs(*((unsigned short *) &buf[2]));
712 712
713-#ifdef CONFIG_FEATURE_TFTP_DEBUG 713-#ifdef CONFIG_FEATURE_TFTP_DEBUG
714- fprintf(stderr, "received %d bytes: %04x %04x\n", len, opcode, tmp); 714- fprintf(stderr, "received %d bytes: %04x %04x\n", len, opcode, tmp);
715-#endif 715-#endif
716+ dprintf("received %d bytes: %04x %04x\n", len, opcode, tmp); 716+ dprintf("received %d bytes: %04x %04x\n", len, opcode, tmp);
717+ dprintf("master_client=%d\n", master_client); 717+ dprintf("master_client=%d\n", master_client);
718 718
719 if (opcode == TFTP_ERROR) { 719 if (opcode == TFTP_ERROR) {
720 char *msg = NULL; 720 char *msg = NULL;
721@@ -393,55 +676,116 @@ 721@@ -393,55 +676,116 @@
722 break; 722 break;
723 } 723 }
724 724
725-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE 725-#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
726- if (want_option_ack) { 726- if (want_option_ack) {
727+#ifdef TFTP_OPTIONS 727+#ifdef TFTP_OPTIONS
728 728
729- want_option_ack = 0; 729- want_option_ack = 0;
730+ if (opcode == TFTP_OACK) { 730+ if (opcode == TFTP_OACK) {
731 731
732- if (opcode == TFTP_OACK) { 732- if (opcode == TFTP_OACK) {
733+ /* server seems to support options */ 733+ /* server seems to support options */
734 734
735- /* server seems to support options */ 735- /* server seems to support options */
736+ char *res; 736+ char *res;
737+ 737+
738+ block_nr = 0; /* acknowledge option packet with block number 0 */ 738+ block_nr = 0; /* acknowledge option packet with block number 0 */
739+ opcode = cmd_put ? TFTP_DATA : TFTP_ACK; 739+ opcode = cmd_put ? TFTP_DATA : TFTP_ACK;
740 740
741- char *res; 741- char *res;
742 742
743- res = tftp_option_get(&buf[2], len-2, 743- res = tftp_option_get(&buf[2], len-2,
744- "blksize"); 744- "blksize");
745+#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE 745+#ifdef CONFIG_FEATURE_TFTP_BLOCKSIZE
746+ res = tftp_option_get(&buf[2], len-2, "blksize"); 746+ res = tftp_option_get(&buf[2], len-2, "blksize");
747 747
748- if (res) { 748- if (res) {
749- int blksize = atoi(res); 749- int blksize = atoi(res);
750- 750-
751- if (tftp_blocksize_check(blksize, 751- if (tftp_blocksize_check(blksize,
752- tftp_bufsize - 4)) { 752- tftp_bufsize - 4)) {
753+ if (res) { 753+ if (res) {
754+ int blksize = atoi(res); 754+ int blksize = atoi(res);
755 755
756- if (cmd_put) { 756- if (cmd_put) {
757- opcode = TFTP_DATA; 757- opcode = TFTP_DATA;
758- } 758- }
@@ -782,10 +782,10 @@ diff -u -r1.25 tftp.c
782- bb_error_msg("bad server option"); 782- bb_error_msg("bad server option");
783- break; 783- break;
784- } 784- }
785 785
786- bb_error_msg("warning: blksize not supported by server" 786- bb_error_msg("warning: blksize not supported by server"
787- " - reverting to 512"); 787- " - reverting to 512");
788 788
789- tftp_bufsize = TFTP_BLOCKSIZE_DEFAULT + 4; 789- tftp_bufsize = TFTP_BLOCKSIZE_DEFAULT + 4;
790+#ifdef CONFIG_FEATURE_TFTP_MULTICAST 790+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
791+ res = tftp_option_get(&buf[2], len-2, "multicast"); 791+ res = tftp_option_get(&buf[2], len-2, "multicast");
@@ -837,9 +837,9 @@ diff -u -r1.25 tftp.c
837 } 837 }
838+ else 838+ else
839 #endif 839 #endif
840 840
841 if (cmd_get && (opcode == TFTP_DATA)) { 841 if (cmd_get && (opcode == TFTP_DATA)) {
842 842
843+#ifdef CONFIG_FEATURE_TFTP_MULTICAST 843+#ifdef CONFIG_FEATURE_TFTP_MULTICAST
844+ if (option->multicast) { 844+ if (option->multicast) {
845+ int bn = tmp - 1; 845+ int bn = tmp - 1;
@@ -867,35 +867,35 @@ diff -u -r1.25 tftp.c
867+#endif 867+#endif
868+ 868+
869 if (tmp == block_nr) { 869 if (tmp == block_nr) {
870 870
871 len = write(localfd, &buf[4], len - 4); 871 len = write(localfd, &buf[4], len - 4);
872@@ -452,15 +796,14 @@ 872@@ -452,15 +796,14 @@
873 } 873 }
874 874
875 if (len != (tftp_bufsize - 4)) { 875 if (len != (tftp_bufsize - 4)) {
876- finished++; 876- finished++;
877+ finished = 1; 877+ finished = 1;
878 } 878 }
879 879
880 opcode = TFTP_ACK; 880 opcode = TFTP_ACK;
881- continue; 881- continue;
882 } 882 }
883 } 883 }
884 884
885- if (cmd_put && (opcode == TFTP_ACK)) { 885- if (cmd_put && (opcode == TFTP_ACK)) {
886+ else if (cmd_put && opcode == TFTP_ACK) { 886+ else if (cmd_put && opcode == TFTP_ACK) {
887 887
888 if (tmp == (unsigned short)(block_nr - 1)) { 888 if (tmp == (unsigned short)(block_nr - 1)) {
889 if (finished) { 889 if (finished) {
890@@ -468,15 +811,19 @@ 890@@ -468,15 +811,19 @@
891 } 891 }
892 892
893 opcode = TFTP_DATA; 893 opcode = TFTP_DATA;
894- continue; 894- continue;
895 } 895 }
896 } 896 }
897 } 897 }
898 898
899 #ifdef CONFIG_FEATURE_CLEAN_UP 899 #ifdef CONFIG_FEATURE_CLEAN_UP
900 close(socketfd); 900 close(socketfd);
901+ free(buf); 901+ free(buf);
@@ -904,10 +904,10 @@ diff -u -r1.25 tftp.c
904+ if (mcblockmap != NULL) 904+ if (mcblockmap != NULL)
905+ free(mcblockmap); 905+ free(mcblockmap);
906+#endif 906+#endif
907 907
908- free(buf); 908- free(buf);
909 #endif 909 #endif
910 910
911 return finished ? EXIT_SUCCESS : EXIT_FAILURE; 911 return finished ? EXIT_SUCCESS : EXIT_FAILURE;
912@@ -487,13 +834,18 @@ 912@@ -487,13 +834,18 @@
913 struct hostent *host = NULL; 913 struct hostent *host = NULL;
@@ -927,13 +927,13 @@ diff -u -r1.25 tftp.c
927+ .client_timeout = TFTP_TIMEOUT, 927+ .client_timeout = TFTP_TIMEOUT,
928+ .server_timeout = TFTP_TIMEOUT, 928+ .server_timeout = TFTP_TIMEOUT,
929+ }; 929+ };
930 930
931 /* figure out what to pass to getopt */ 931 /* figure out what to pass to getopt */
932 932
933@@ -515,13 +867,45 @@ 933@@ -515,13 +867,45 @@
934 #define PUT 934 #define PUT
935 #endif 935 #endif
936 936
937- while ((opt = getopt(argc, argv, BS GET PUT "l:r:")) != -1) { 937- while ((opt = getopt(argc, argv, BS GET PUT "l:r:")) != -1) {
938+#ifdef CONFIG_FEATURE_TFTP_TIMEOUT 938+#ifdef CONFIG_FEATURE_TFTP_TIMEOUT
939+#define TO "T:t:" 939+#define TO "T:t:"
@@ -994,7 +994,7 @@ diff -u -r1.25 tftp.c
994+ debug = 1; 994+ debug = 1;
995+ break; 995+ break;
996+#endif 996+#endif
997 case 'l': 997 case 'l':
998 localfile = bb_xstrdup(optarg); 998 localfile = bb_xstrdup(optarg);
999 break; 999 break;
1000 case 'r': 1000 case 'r':
@@ -1004,7 +1004,7 @@ diff -u -r1.25 tftp.c
1004+ bb_show_usage(); 1004+ bb_show_usage();
1005 } 1005 }
1006 } 1006 }
1007 1007
1008 if ((cmd == 0) || (optind == argc)) { 1008 if ((cmd == 0) || (optind == argc)) {
1009 bb_show_usage(); 1009 bb_show_usage();
1010 } 1010 }
@@ -1018,7 +1018,7 @@ diff -u -r1.25 tftp.c
1018@@ -566,14 +966,12 @@ 1018@@ -566,14 +966,12 @@
1019 host = xgethostbyname(argv[optind]); 1019 host = xgethostbyname(argv[optind]);
1020 port = bb_lookup_port(argv[optind + 1], "udp", 69); 1020 port = bb_lookup_port(argv[optind + 1], "udp", 69);
1021 1021
1022-#ifdef CONFIG_FEATURE_TFTP_DEBUG 1022-#ifdef CONFIG_FEATURE_TFTP_DEBUG
1023- fprintf(stderr, "using server \"%s\", remotefile \"%s\", " 1023- fprintf(stderr, "using server \"%s\", remotefile \"%s\", "
1024+ dprintf("using server \"%s\", remotefile \"%s\", " 1024+ dprintf("using server \"%s\", remotefile \"%s\", "
@@ -1026,10 +1026,10 @@ diff -u -r1.25 tftp.c
1026 inet_ntoa(*((struct in_addr *) host->h_addr)), 1026 inet_ntoa(*((struct in_addr *) host->h_addr)),
1027 remotefile, localfile); 1027 remotefile, localfile);
1028-#endif 1028-#endif
1029 1029
1030- result = tftp(cmd, host, remotefile, fd, port, blocksize); 1030- result = tftp(cmd, host, remotefile, fd, port, blocksize);
1031+ result = tftp(cmd, host, remotefile, fd, port, &option); 1031+ result = tftp(cmd, host, remotefile, fd, port, &option);
1032 1032
1033 #ifdef CONFIG_FEATURE_CLEAN_UP 1033 #ifdef CONFIG_FEATURE_CLEAN_UP
1034 if (!(fd == fileno(stdout) || fd == fileno(stdin))) { 1034 if (!(fd == fileno(stdout) || fd == fileno(stdin))) {
1035@@ -582,3 +980,18 @@ 1035@@ -582,3 +980,18 @@
diff --git a/patches/udhcp_additional_items.diff b/patches/udhcp_additional_items.diff
index 262ccc266..933be2ad4 100644
--- a/patches/udhcp_additional_items.diff
+++ b/patches/udhcp_additional_items.diff
@@ -12,7 +12,7 @@ diff -u -r1.191 usage.h
12+ "\t-R,\t--require=NAME\tAdd NAME to request\n" \ 12+ "\t-R,\t--require=NAME\tAdd NAME to request\n" \
13 "\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \ 13 "\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
14 "\t-v,\t--version\tDisplay version" 14 "\t-v,\t--version\tDisplay version"
15 15
16Index: networking/udhcp/README.udhcpc 16Index: networking/udhcp/README.udhcpc
17=================================================================== 17===================================================================
18RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v 18RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v
@@ -29,12 +29,12 @@ diff -u -r1.3 README.udhcpc
29 /usr/share/udhcpc/default.script) 29 /usr/share/udhcpc/default.script)
30 -v, --version Display version 30 -v, --version Display version
31@@ -101,6 +102,8 @@ 31@@ -101,6 +102,8 @@
32 32
33 additional options are easily added in options.c. 33 additional options are easily added in options.c.
34 34
35+By default, only a few basic items are requested. To request additional 35+By default, only a few basic items are requested. To request additional
36+items use the -R option. Example: "-R rootpath" 36+items use the -R option. Example: "-R rootpath"
37 37
38 note on udhcpc's random seed 38 note on udhcpc's random seed
39 --------------------------- 39 ---------------------------
40Index: networking/udhcp/dhcpc.c 40Index: networking/udhcp/dhcpc.c
@@ -67,7 +67,7 @@ diff -u -r1.16 dhcpc.c
67- c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index); 67- c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index);
68+ c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:R:s:v", arg_options, &option_index); 68+ c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:R:s:v", arg_options, &option_index);
69 if (c == -1) break; 69 if (c == -1) break;
70 70
71 switch (c) { 71 switch (c) {
72@@ -254,6 +256,11 @@ 72@@ -254,6 +256,11 @@
73 case 'r': 73 case 'r':
@@ -91,7 +91,7 @@ diff -u -r1.7 options.c
91@@ -57,7 +57,19 @@ 91@@ -57,7 +57,19 @@
92 [OPTION_S32] = 4 92 [OPTION_S32] = 4
93 }; 93 };
94 94
95- 95-
96+/* find and mark requested item as required */ 96+/* find and mark requested item as required */
97+int require_option(char *name) 97+int require_option(char *name)
@@ -105,7 +105,7 @@ diff -u -r1.7 options.c
105+ } 105+ }
106+ return 1; 106+ return 1;
107+} 107+}
108+ 108+
109 /* get an option with bounds checking (warning, not aligned). */ 109 /* get an option with bounds checking (warning, not aligned). */
110 uint8_t *get_option(struct dhcpMessage *packet, int code) 110 uint8_t *get_option(struct dhcpMessage *packet, int code)
111 { 111 {
@@ -119,7 +119,7 @@ diff -u -r1.5 options.h
119@@ -30,6 +30,7 @@ 119@@ -30,6 +30,7 @@
120 extern struct dhcp_option dhcp_options[]; 120 extern struct dhcp_option dhcp_options[];
121 extern int option_lengths[]; 121 extern int option_lengths[];
122 122
123+int require_option(char *name); 123+int require_option(char *name);
124 uint8_t *get_option(struct dhcpMessage *packet, int code); 124 uint8_t *get_option(struct dhcpMessage *packet, int code);
125 int end_option(uint8_t *optionptr); 125 int end_option(uint8_t *optionptr);
diff --git a/patches/udhcp_config_paths.diff b/patches/udhcp_config_paths.diff
index 299a68a8e..1d3a6b4b0 100644
--- a/patches/udhcp_config_paths.diff
+++ b/patches/udhcp_config_paths.diff
@@ -13,7 +13,7 @@ diff -u -r1.191 usage.h
13+ "\t-s,\t--script=file\tRun file at dhcp events (default: " \ 13+ "\t-s,\t--script=file\tRun file at dhcp events (default: " \
14+ CONFIG_UDHCPC_SCRIPT_PATH ")\n" \ 14+ CONFIG_UDHCPC_SCRIPT_PATH ")\n" \
15 "\t-v,\t--version\tDisplay version" 15 "\t-v,\t--version\tDisplay version"
16 16
17 #define udhcpd_trivial_usage \ 17 #define udhcpd_trivial_usage \
18Index: networking/udhcp/AUTHORS 18Index: networking/udhcp/AUTHORS
19=================================================================== 19===================================================================
@@ -24,11 +24,11 @@ diff -u -r1.3 AUTHORS
24+++ b/networking/udhcp/AUTHORS 5 Mar 2004 13:20:11 -0000 24+++ b/networking/udhcp/AUTHORS 5 Mar 2004 13:20:11 -0000
25@@ -10,5 +10,5 @@ 25@@ -10,5 +10,5 @@
26 Moreton Bay (http://www.moretonbay.com/) 26 Moreton Bay (http://www.moretonbay.com/)
27 Lineo (http://opensource.lineo.com)
28 Vladimir Oleynik <dzo@simtrea.ru> Size optimizations 27 Vladimir Oleynik <dzo@simtrea.ru> Size optimizations
28
29- 29-
30+Tony J. White <tjw@tjw.org> additional busybox build options 30+Tony J. White <tjw@tjw.org> additional busybox build options
31 31
32Index: networking/udhcp/Config.in 32Index: networking/udhcp/Config.in
33=================================================================== 33===================================================================
34RCS file: /var/cvs/busybox/networking/udhcp/Config.in,v 34RCS file: /var/cvs/busybox/networking/udhcp/Config.in,v
@@ -37,32 +37,32 @@ diff -u -r1.5 Config.in
37--- a/networking/udhcp/Config.in 22 Oct 2003 09:58:38 -0000 1.5 37--- a/networking/udhcp/Config.in 22 Oct 2003 09:58:38 -0000 1.5
38+++ b/networking/udhcp/Config.in 5 Mar 2004 13:20:11 -0000 38+++ b/networking/udhcp/Config.in 5 Mar 2004 13:20:11 -0000
39@@ -58,5 +58,62 @@ 39@@ -58,5 +58,62 @@
40 40
41 See http://udhcp.busybox.net for further details. 41 See http://udhcp.busybox.net for further details.
42 42
43+menu "udhcpd Configuration Options" 43+menu "udhcpd Configuration Options"
44+ depends on CONFIG_UDHCPD 44+ depends on CONFIG_UDHCPD
45+ 45+
46+config CONFIG_UDHCPD_CONF_PATH 46+config CONFIG_UDHCPD_CONF_PATH
47+ string "Path to default udhcpd.conf" 47+ string "Path to default udhcpd.conf"
48+ default "/etc/udhcpd.conf" 48+ default "/etc/udhcpd.conf"
49+ depends on CONFIG_UDHCPD 49+ depends on CONFIG_UDHCPD
50+ help 50+ help
51+ The full path to udhcpd's default configuration file. 51+ The full path to udhcpd's default configuration file.
52+ (default is: /etc/udhcpd.conf) 52+ (default is: /etc/udhcpd.conf)
53+ 53+
54+config CONFIG_UDHCPD_LEASE_PATH 54+config CONFIG_UDHCPD_LEASE_PATH
55+ string "Path to default udhcpd.leases" 55+ string "Path to default udhcpd.leases"
56+ default "/var/lib/misc/udhcpd.leases" 56+ default "/var/lib/misc/udhcpd.leases"
57+ depends on CONFIG_UDHCPD 57+ depends on CONFIG_UDHCPD
58+ help 58+ help
59+ The full path to udhcpd's default leases file. 59+ The full path to udhcpd's default leases file.
60+ (default is: /var/lib/misc/udhcpd.leases) 60+ (default is: /var/lib/misc/udhcpd.leases)
61+ 61+
62+config CONFIG_UDHCPD_PID_PATH 62+config CONFIG_UDHCPD_PID_PATH
63+ string "Path to default udhcpd PID file" 63+ string "Path to default udhcpd PID file"
64+ default "/var/run/udhcpd.pid" 64+ default "/var/run/udhcpd.pid"
65+ depends on CONFIG_UDHCPD 65+ depends on CONFIG_UDHCPD
66+ help 66+ help
67+ The full path to udhcpd's default pid file. 67+ The full path to udhcpd's default pid file.
68+ (default is: /var/run/udhcpd.pid) 68+ (default is: /var/run/udhcpd.pid)
@@ -79,26 +79,26 @@ diff -u -r1.5 Config.in
79+ The full path to udhcpc's default event script file. 79+ The full path to udhcpc's default event script file.
80+ (default is: /usr/share/udhcpc/default.script OR 80+ (default is: /usr/share/udhcpc/default.script OR
81+ /share/udhcpc/default.script if CONFIG_INSTALL_NO_USR is set) 81+ /share/udhcpc/default.script if CONFIG_INSTALL_NO_USR is set)
82+ 82+
83+ When udhcpc is started it executes this script to take care 83+ When udhcpc is started it executes this script to take care
84+ of system tasks after it completes DHCP communication. Such 84+ of system tasks after it completes DHCP communication. Such
85+ tasks include putting network interfaces up or down, setting 85+ tasks include putting network interfaces up or down, setting
86+ DNS info, adding routing information, etc. 86+ DNS info, adding routing information, etc.
87+ 87+
88+if CONFIG_INSTALL_NO_USR 88+if CONFIG_INSTALL_NO_USR
89+config CONFIG_UDHCPC_SCRIPT_PATH 89+config CONFIG_UDHCPC_SCRIPT_PATH
90+ default "/share/udhcpc/default.script" 90+ default "/share/udhcpc/default.script"
91+endif 91+endif
92+ 92+
93+if !CONFIG_INSTALL_NO_USR 93+if !CONFIG_INSTALL_NO_USR
94+config CONFIG_UDHCPC_SCRIPT_PATH 94+config CONFIG_UDHCPC_SCRIPT_PATH
95+ default "/usr/share/udhcpc/default.script" 95+ default "/usr/share/udhcpc/default.script"
96+endif 96+endif
97+ 97+
98+endmenu 98+endmenu
99+ 99+
100 endmenu 100 endmenu
101 101
102Index: networking/udhcp/README 102Index: networking/udhcp/README
103=================================================================== 103===================================================================
104RCS file: /var/cvs/busybox/networking/udhcp/README,v 104RCS file: /var/cvs/busybox/networking/udhcp/README,v
@@ -109,33 +109,33 @@ diff -u -r1.3 README
109@@ -9,27 +9,42 @@ 109@@ -9,27 +9,42 @@
110 compile time options 110 compile time options
111 ------------------- 111 -------------------
112 112
113-The Makefile contains three of the compile time options: 113-The Makefile contains three of the compile time options:
114+The following options can be adjusted when configuring busybox: 114+The following options can be adjusted when configuring busybox:
115 115
116- UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra 116- UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra
117- debugging output, compile with -g, and not fork to the background when 117- debugging output, compile with -g, and not fork to the background when
118- run. 118- run.
119- UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its 119- UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its
120- messages syslog, otherwise, it will attempt to log them to stdout. 120- messages syslog, otherwise, it will attempt to log them to stdout.
121- 121-
122- COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd, 122- COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd,
123- is created. If called as udhcpd, the dhcp server will be started. 123- is created. If called as udhcpd, the dhcp server will be started.
124- If called as udhcpc, the dhcp client will be started. 124- If called as udhcpc, the dhcp client will be started.
125- 125-
126-dhcpd.h contains the other three compile time options: 126-dhcpd.h contains the other three compile time options:
127- 127-
128- LEASE_TIME: The default lease time if not specified in the config 128- LEASE_TIME: The default lease time if not specified in the config
129- file. 129- file.
130+ CONFIG_FEATURE_UDHCP_DEBUG: 130+ CONFIG_FEATURE_UDHCP_DEBUG:
131+ If this is defined, udhcpd will output extra debugging output, 131+ If this is defined, udhcpd will output extra debugging output,
132+ compile with -g, and not fork to the background when run. 132+ compile with -g, and not fork to the background when run.
133 133
134- LEASES_FILE: The default file for storing leases. 134- LEASES_FILE: The default file for storing leases.
135- 135-
136- DHCPD_CONFIG_FILE: The defualt config file to use. 136- DHCPD_CONFIG_FILE: The defualt config file to use.
137+ CONFIG_FEATURE_UDHCP_SYSLOG: 137+ CONFIG_FEATURE_UDHCP_SYSLOG:
138+ If this is defined, udhcpd will log all its messages syslog, 138+ If this is defined, udhcpd will log all its messages syslog,
139+ otherwise, it will attempt to log them to stdout. 139+ otherwise, it will attempt to log them to stdout.
140+ 140+
141+ CONFIG_UDHCPD_CONF_PATH: 141+ CONFIG_UDHCPD_CONF_PATH:
@@ -158,14 +158,14 @@ diff -u -r1.3 README
158+ 158+
159+ 159+
160+dhcpd.h contains the another compile time option: 160+dhcpd.h contains the another compile time option:
161 161
162+ LEASE_TIME: 162+ LEASE_TIME:
163+ The default lease time if not specified in the config file. 163+ The default lease time if not specified in the config file.
164+ This option can also be changed at runtime with the 'lease' 164+ This option can also be changed at runtime with the 'lease'
165+ configuration option. 165+ configuration option.
166+ 166+
167 options.c contains a set of dhcp options for the client: 167 options.c contains a set of dhcp options for the client:
168 168
169 name[10]: The name of the option as it will appear in scripts 169 name[10]: The name of the option as it will appear in scripts
170Index: networking/udhcp/README.udhcpc 170Index: networking/udhcp/README.udhcpc
171=================================================================== 171===================================================================
@@ -182,8 +182,8 @@ diff -u -r1.3 README.udhcpc
182+ /usr/share/udhcpc/default.script or 182+ /usr/share/udhcpc/default.script or
183+ CONFIG_UDHCPC_SCRIPT_PATH at build time) 183+ CONFIG_UDHCPC_SCRIPT_PATH at build time)
184 -v, --version Display version 184 -v, --version Display version
185 185
186 186
187Index: networking/udhcp/README.udhcpd 187Index: networking/udhcp/README.udhcpd
188=================================================================== 188===================================================================
189RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpd,v 189RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpd,v
@@ -192,21 +192,21 @@ diff -u -r1.1 README.udhcpd
192--- a/networking/udhcp/README.udhcpd 31 Oct 2002 19:21:27 -0000 1.1 192--- a/networking/udhcp/README.udhcpd 31 Oct 2002 19:21:27 -0000 1.1
193+++ b/networking/udhcp/README.udhcpd 5 Mar 2004 13:20:11 -0000 193+++ b/networking/udhcp/README.udhcpd 5 Mar 2004 13:20:11 -0000
194@@ -50,10 +50,14 @@ 194@@ -50,10 +50,14 @@
195 195
196 compile time options 196 compile time options
197 ------------------- 197 -------------------
198+ 198+
199+During busybox configuration, you can change the default paths for 199+During busybox configuration, you can change the default paths for
200+udhcpd.conf, udhcpd.leases, and udhcpd.pid files. See README for 200+udhcpd.conf, udhcpd.leases, and udhcpd.pid files. See README for
201+more details. 201+more details.
202 202
203-dhcpd.h contains the other two compile time options: 203-dhcpd.h contains the other two compile time options:
204+dhcpd.h contains the compile time option: 204+dhcpd.h contains the compile time option:
205 205
206 LEASE_TIME: The default lease time if not specified in the config 206 LEASE_TIME: The default lease time if not specified in the config
207 file. 207 file.
208+ 208+
209 209
210- DHCPD_CONFIG_FILE: The defualt config file to use. 210- DHCPD_CONFIG_FILE: The defualt config file to use.
211Index: networking/udhcp/dhcpc.h 211Index: networking/udhcp/dhcpc.h
212=================================================================== 212===================================================================
@@ -218,14 +218,14 @@ diff -u -r1.4 dhcpc.h
218@@ -2,7 +2,11 @@ 218@@ -2,7 +2,11 @@
219 #ifndef _DHCPC_H 219 #ifndef _DHCPC_H
220 #define _DHCPC_H 220 #define _DHCPC_H
221 221
222-#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script" 222-#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
223+#ifdef CONFIG_UDHCPC_SCRIPT_PATH 223+#ifdef CONFIG_UDHCPC_SCRIPT_PATH
224+ #define DEFAULT_SCRIPT CONFIG_UDHCPC_SCRIPT_PATH 224+ #define DEFAULT_SCRIPT CONFIG_UDHCPC_SCRIPT_PATH
225+#else 225+#else
226+ #define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script" 226+ #define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
227+#endif 227+#endif
228 228
229 /* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */ 229 /* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
230 #include "libbb_udhcp.h" 230 #include "libbb_udhcp.h"
231Index: networking/udhcp/dhcpd.c 231Index: networking/udhcp/dhcpd.c
@@ -240,25 +240,25 @@ diff -u -r1.5 dhcpd.c
240 int max_sock; 240 int max_sock;
241 unsigned long num_ips; 241 unsigned long num_ips;
242+ int daemonize = 1; 242+ int daemonize = 1;
243+ 243+
244+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) { 244+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
245+ daemonize = 0; 245+ daemonize = 0;
246+ argv++; 246+ argv++;
247+ argc--; 247+ argc--;
248+ } 248+ }
249 249
250 memset(&server_config, 0, sizeof(struct server_config_t)); 250 memset(&server_config, 0, sizeof(struct server_config_t));
251 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]); 251 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
252@@ -99,9 +106,8 @@ 252@@ -99,9 +106,8 @@
253 &server_config.server, server_config.arp) < 0) 253 &server_config.server, server_config.arp) < 0)
254 return 1; 254 return 1;
255 255
256-#ifndef UDHCP_DEBUG 256-#ifndef UDHCP_DEBUG
257- background(server_config.pidfile); /* hold lock during fork. */ 257- background(server_config.pidfile); /* hold lock during fork. */
258-#endif 258-#endif
259+ if(daemonize) 259+ if(daemonize)
260+ background(server_config.pidfile); /* hold lock during fork. */ 260+ background(server_config.pidfile); /* hold lock during fork. */
261 261
262 /* Setup the signal pipe */ 262 /* Setup the signal pipe */
263 udhcp_sp_setup(); 263 udhcp_sp_setup();
264Index: networking/udhcp/dhcpd.h 264Index: networking/udhcp/dhcpd.h
@@ -269,7 +269,7 @@ diff -u -r1.5 dhcpd.h
269--- a/networking/udhcp/dhcpd.h 30 Jan 2004 23:45:12 -0000 1.5 269--- a/networking/udhcp/dhcpd.h 30 Jan 2004 23:45:12 -0000 1.5
270+++ b/networking/udhcp/dhcpd.h 5 Mar 2004 13:20:12 -0000 270+++ b/networking/udhcp/dhcpd.h 5 Mar 2004 13:20:12 -0000
271@@ -15,11 +15,25 @@ 271@@ -15,11 +15,25 @@
272 272
273 /* the period of time the client is allowed to use that address */ 273 /* the period of time the client is allowed to use that address */
274 #define LEASE_TIME (60*60*24*10) /* 10 days of seconds */ 274 #define LEASE_TIME (60*60*24*10) /* 10 days of seconds */
275-#define LEASES_FILE "/var/lib/misc/udhcpd.leases" 275-#define LEASES_FILE "/var/lib/misc/udhcpd.leases"
@@ -279,7 +279,7 @@ diff -u -r1.5 dhcpd.h
279+#else 279+#else
280+ #define LEASES_FILE "/var/lib/misc/udhcpd.leases" 280+ #define LEASES_FILE "/var/lib/misc/udhcpd.leases"
281+#endif 281+#endif
282 282
283 /* where to find the DHCP server configuration file */ 283 /* where to find the DHCP server configuration file */
284-#define DHCPD_CONF_FILE "/etc/udhcpd.conf" 284-#define DHCPD_CONF_FILE "/etc/udhcpd.conf"
285+#ifdef CONFIG_UDHCPD_CONF_PATH 285+#ifdef CONFIG_UDHCPD_CONF_PATH
@@ -287,7 +287,7 @@ diff -u -r1.5 dhcpd.h
287+#else 287+#else
288+ #define DHCPD_CONF_FILE "/etc/udhcpd.conf" 288+ #define DHCPD_CONF_FILE "/etc/udhcpd.conf"
289+#endif 289+#endif
290 290
291+#ifdef CONFIG_UDHCPD_PID_PATH 291+#ifdef CONFIG_UDHCPD_PID_PATH
292+ #define DHCPD_PID_FILE CONFIG_UDHCPD_PID_PATH 292+ #define DHCPD_PID_FILE CONFIG_UDHCPD_PID_PATH
293+#else 293+#else
@@ -322,7 +322,7 @@ diff -u -r1.5 libbb_udhcp.h
322@@ -3,11 +3,6 @@ 322@@ -3,11 +3,6 @@
323 /* bit of a hack, do this no matter what the order of the includes. 323 /* bit of a hack, do this no matter what the order of the includes.
324 * (for busybox) */ 324 * (for busybox) */
325 325
326-#ifdef CONFIG_INSTALL_NO_USR 326-#ifdef CONFIG_INSTALL_NO_USR
327-#undef DEFUALT_SCRIPT 327-#undef DEFUALT_SCRIPT
328-#define DEFAULT_SCRIPT "/share/udhcpc/default.script" 328-#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
@@ -330,4 +330,4 @@ diff -u -r1.5 libbb_udhcp.h
330- 330-
331 #ifndef _LIBBB_UDHCP_H 331 #ifndef _LIBBB_UDHCP_H
332 #define _LIBBB_UDHCP_H 332 #define _LIBBB_UDHCP_H
333 333
diff --git a/patches/udhcpd_foreground.diff b/patches/udhcpd_foreground.diff
index 9f1e3b913..3b8c7eb0c 100644
--- a/patches/udhcpd_foreground.diff
+++ b/patches/udhcpd_foreground.diff
@@ -10,24 +10,24 @@ diff -u -r1.5 dhcpd.c
10 int max_sock; 10 int max_sock;
11 unsigned long num_ips; 11 unsigned long num_ips;
12+ int daemonize = 1; 12+ int daemonize = 1;
13+ 13+
14+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) { 14+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
15+ daemonize = 0; 15+ daemonize = 0;
16+ argv++; 16+ argv++;
17+ argc--; 17+ argc--;
18+ } 18+ }
19 19
20 memset(&server_config, 0, sizeof(struct server_config_t)); 20 memset(&server_config, 0, sizeof(struct server_config_t));
21 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]); 21 read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
22@@ -99,9 +106,8 @@ 22@@ -99,9 +106,8 @@
23 &server_config.server, server_config.arp) < 0) 23 &server_config.server, server_config.arp) < 0)
24 return 1; 24 return 1;
25 25
26-#ifndef UDHCP_DEBUG 26-#ifndef UDHCP_DEBUG
27- background(server_config.pidfile); /* hold lock during fork. */ 27- background(server_config.pidfile); /* hold lock during fork. */
28-#endif 28-#endif
29+ if(daemonize) 29+ if(daemonize)
30+ background(server_config.pidfile); /* hold lock during fork. */ 30+ background(server_config.pidfile); /* hold lock during fork. */
31 31
32 /* Setup the signal pipe */ 32 /* Setup the signal pipe */
33 udhcp_sp_setup(); 33 udhcp_sp_setup();
diff --git a/procps/Makefile b/procps/Makefile
index 3751f79dd..0238f7ebb 100644
--- a/procps/Makefile
+++ b/procps/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/procps/Makefile.in b/procps/Makefile.in
index 723dd9ffb..1c2e00f7b 100644
--- a/procps/Makefile.in
+++ b/procps/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/procps/free.c b/procps/free.c
index dbc606c94..4fb047d48 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini free implementation for busybox 3 * Mini free implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -64,11 +64,11 @@ extern int free_main(int argc, char **argv)
64 if (argc > 1 && **(argv + 1) == '-') 64 if (argc > 1 && **(argv + 1) == '-')
65 bb_show_usage(); 65 bb_show_usage();
66 66
67 printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free", 67 printf("%6s%13s%13s%13s%13s%13s\n", "", "total", "used", "free",
68 "shared", "buffers"); 68 "shared", "buffers");
69 69
70 printf("%6s%13ld%13ld%13ld%13ld%13ld\n", "Mem:", info.totalram, 70 printf("%6s%13ld%13ld%13ld%13ld%13ld\n", "Mem:", info.totalram,
71 info.totalram-info.freeram, info.freeram, 71 info.totalram-info.freeram, info.freeram,
72 info.sharedram, info.bufferram); 72 info.sharedram, info.bufferram);
73 73
74#ifndef __uClinux__ 74#ifndef __uClinux__
diff --git a/procps/kill.c b/procps/kill.c
index 22bb98a12..a07855e79 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -3,7 +3,7 @@
3 * Mini kill/killall implementation for busybox 3 * Mini kill/killall implementation for busybox
4 * 4 *
5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. 5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
6 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
diff --git a/procps/pidof.c b/procps/pidof.c
index 2fe8ecd25..413864a37 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * pidof implementation for busybox 3 * pidof implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/procps/ps.c b/procps/ps.c
index b9d15b861..0b603314d 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini ps implementation(s) for busybox 3 * Mini ps implementation(s) for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free 8 * under the terms of the GNU General Public License as published by the Free
diff --git a/procps/renice.c b/procps/renice.c
index a81156eea..a6f0820df 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -31,17 +31,17 @@
31extern int renice_main(int argc, char **argv) 31extern int renice_main(int argc, char **argv)
32{ 32{
33 int prio, status = EXIT_SUCCESS; 33 int prio, status = EXIT_SUCCESS;
34 34
35 if (argc < 3) bb_show_usage(); 35 if (argc < 3) bb_show_usage();
36 36
37 prio = atoi(*++argv); 37 prio = atoi(*++argv);
38 if (prio > 20) prio = 20; 38 if (prio > 20) prio = 20;
39 if (prio < -20) prio = -20; 39 if (prio < -20) prio = -20;
40 40
41 while (*++argv) { 41 while (*++argv) {
42 int ps = atoi(*argv); 42 int ps = atoi(*argv);
43 int oldp = getpriority(PRIO_PROCESS, ps); 43 int oldp = getpriority(PRIO_PROCESS, ps);
44 44
45 if (setpriority(PRIO_PROCESS, ps, prio) == 0) { 45 if (setpriority(PRIO_PROCESS, ps, prio) == 0) {
46 printf("%d: old priority %d, new priority %d\n", ps, oldp, prio ); 46 printf("%d: old priority %d, new priority %d\n", ps, oldp, prio );
47 } else { 47 } else {
diff --git a/procps/sysctl.c b/procps/sysctl.c
index ee883e163..359dcc041 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -17,7 +17,7 @@
17 * - added -p <preload> to preload values from a file 17 * - added -p <preload> to preload values from a file
18 * v1.01.1 18 * v1.01.1
19 * - busybox applet aware by <solar@gentoo.org> 19 * - busybox applet aware by <solar@gentoo.org>
20 * 20 *
21 */ 21 */
22 22
23#include <stdio.h> 23#include <stdio.h>
@@ -70,7 +70,7 @@ static void dwrite_str(int fd, const char *buf)
70} 70}
71 71
72/* 72/*
73 * sysctl_main()... 73 * sysctl_main()...
74 */ 74 */
75int sysctl_main(int argc, char **argv) 75int sysctl_main(int argc, char **argv)
76{ 76{
@@ -126,7 +126,7 @@ int sysctl_main(int argc, char **argv)
126 126
127 127
128/* 128/*
129 * sysctl_preload_file 129 * sysctl_preload_file
130 * preload the sysctl's from a conf file 130 * preload the sysctl's from a conf file
131 * - we parse the file and then reform it (strip out whitespace) 131 * - we parse the file and then reform it (strip out whitespace)
132 */ 132 */
@@ -250,7 +250,7 @@ int sysctl_write_setting(const char *setting, int output)
250 250
251 251
252/* 252/*
253 * Read a sysctl setting 253 * Read a sysctl setting
254 * 254 *
255 */ 255 */
256int sysctl_read_setting(const char *setting, int output) 256int sysctl_read_setting(const char *setting, int output)
@@ -304,7 +304,7 @@ int sysctl_read_setting(const char *setting, int output)
304 304
305 305
306/* 306/*
307 * Display all the sysctl settings 307 * Display all the sysctl settings
308 * 308 *
309 */ 309 */
310int sysctl_display_all(const char *path, int output, int show_table) 310int sysctl_display_all(const char *path, int output, int show_table)
diff --git a/procps/top.c b/procps/top.c
index 64b3c0732..f619f6923 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -7,11 +7,11 @@
7 * This reads the PIDs of all processes and their status and shows 7 * This reads the PIDs of all processes and their status and shows
8 * the status of processes (first ones that fit to screen) at given 8 * the status of processes (first ones that fit to screen) at given
9 * intervals. 9 * intervals.
10 * 10 *
11 * NOTES: 11 * NOTES:
12 * - At startup this changes to /proc, all the reads are then 12 * - At startup this changes to /proc, all the reads are then
13 * relative to that. 13 * relative to that.
14 * 14 *
15 * (C) Eero Tamminen <oak at welho dot com> 15 * (C) Eero Tamminen <oak at welho dot com>
16 * 16 *
17 * Rewroted by Vladimir Oleynik (C) 2002 <dzo@simtreas.ru> 17 * Rewroted by Vladimir Oleynik (C) 2002 <dzo@simtreas.ru>
@@ -332,7 +332,7 @@ static unsigned long display_generic(void)
332 fscanf(fp, "Mem: %lu %lu %lu %lu %lu %lu", 332 fscanf(fp, "Mem: %lu %lu %lu %lu %lu %lu",
333 &total, &used, &mfree, &shared, &buffers, &cached); 333 &total, &used, &mfree, &shared, &buffers, &cached);
334 } else { 334 } else {
335 /* 335 /*
336 * Revert to manual parsing, which incidentally already has the 336 * Revert to manual parsing, which incidentally already has the
337 * sizes in kilobytes. This should be safe for both 2.4 and 337 * sizes in kilobytes. This should be safe for both 2.4 and
338 * 2.6. 338 * 2.6.
@@ -341,7 +341,7 @@ static unsigned long display_generic(void)
341 341
342 fscanf(fp, "MemFree: %lu %s\n", &mfree, buf); 342 fscanf(fp, "MemFree: %lu %s\n", &mfree, buf);
343 343
344 /* 344 /*
345 * MemShared: is no longer present in 2.6. Report this as 0, 345 * MemShared: is no longer present in 2.6. Report this as 0,
346 * to maintain consistent behavior with normal procps. 346 * to maintain consistent behavior with normal procps.
347 */ 347 */
@@ -354,7 +354,7 @@ static unsigned long display_generic(void)
354 used = total - mfree; 354 used = total - mfree;
355 } 355 }
356 fclose(fp); 356 fclose(fp);
357 357
358 /* read load average */ 358 /* read load average */
359 fp = bb_xfopen("loadavg", "r"); 359 fp = bb_xfopen("loadavg", "r");
360 if (fscanf(fp, "%f %f %f", &avg1, &avg2, &avg3) != 3) { 360 if (fscanf(fp, "%f %f %f", &avg1, &avg2, &avg3) != 3) {
@@ -371,7 +371,7 @@ static unsigned long display_generic(void)
371 cached /= 1024; 371 cached /= 1024;
372 total /= 1024; 372 total /= 1024;
373 } 373 }
374 374
375 /* output memory info and load average */ 375 /* output memory info and load average */
376 /* clear screen & go to top */ 376 /* clear screen & go to top */
377 printf("\e[H\e[J" "Mem: " 377 printf("\e[H\e[J" "Mem: "
@@ -390,7 +390,7 @@ static void display_status(int count, int col)
390 procps_status_t *s = top; 390 procps_status_t *s = top;
391 char rss_str_buf[8]; 391 char rss_str_buf[8];
392 unsigned long total_memory = display_generic(); 392 unsigned long total_memory = display_generic();
393 393
394#ifdef FEATURE_CPU_USAGE_PERCENTAGE 394#ifdef FEATURE_CPU_USAGE_PERCENTAGE
395 /* what info of the processes is shown */ 395 /* what info of the processes is shown */
396 printf("\n\e[7m PID USER STATUS RSS PPID %%CPU %%MEM COMMAND\e[0m\n"); 396 printf("\n\e[7m PID USER STATUS RSS PPID %%CPU %%MEM COMMAND\e[0m\n");
@@ -404,7 +404,7 @@ static void display_status(int count, int col)
404 404
405 pmem = 1000.0 * s->rss / total_memory; 405 pmem = 1000.0 * s->rss / total_memory;
406 if (pmem > 999) pmem = 999; 406 if (pmem > 999) pmem = 999;
407 407
408 if(s->rss > 10*1024) 408 if(s->rss > 10*1024)
409 sprintf(rss_str_buf, "%6ldM", s->rss/1024); 409 sprintf(rss_str_buf, "%6ldM", s->rss/1024);
410 else 410 else
@@ -450,7 +450,7 @@ static void reset_term(void)
450#endif 450#endif
451#endif /* CONFIG_FEATURE_CLEAN_UP */ 451#endif /* CONFIG_FEATURE_CLEAN_UP */
452} 452}
453 453
454static void sig_catcher (int sig) 454static void sig_catcher (int sig)
455{ 455{
456 reset_term(); 456 reset_term();
@@ -609,6 +609,6 @@ int top_main(int argc, char **argv)
609#endif /* CONFIG_FEATURE_USE_TERMIOS */ 609#endif /* CONFIG_FEATURE_USE_TERMIOS */
610 clearmems(); 610 clearmems();
611 } 611 }
612 612
613 return EXIT_SUCCESS; 613 return EXIT_SUCCESS;
614} 614}
diff --git a/procps/uptime.c b/procps/uptime.c
index a974313d7..7e0735c44 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini uptime implementation for busybox 3 * Mini uptime implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -53,8 +53,8 @@ extern int uptime_main(int argc, char **argv)
53 53
54 sysinfo(&info); 54 sysinfo(&info);
55 55
56 printf(" %2d:%02d%s up ", 56 printf(" %2d:%02d%s up ",
57 current_time->tm_hour%12 ? current_time->tm_hour%12 : 12, 57 current_time->tm_hour%12 ? current_time->tm_hour%12 : 12,
58 current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am"); 58 current_time->tm_min, current_time->tm_hour > 11 ? "pm" : "am");
59 updays = (int) info.uptime / (60*60*24); 59 updays = (int) info.uptime / (60*60*24);
60 if (updays) 60 if (updays)
@@ -67,9 +67,9 @@ extern int uptime_main(int argc, char **argv)
67 else 67 else
68 printf("%d min, ", upminutes); 68 printf("%d min, ", upminutes);
69 69
70 printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n", 70 printf("load average: %ld.%02ld, %ld.%02ld, %ld.%02ld\n",
71 LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]), 71 LOAD_INT(info.loads[0]), LOAD_FRAC(info.loads[0]),
72 LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]), 72 LOAD_INT(info.loads[1]), LOAD_FRAC(info.loads[1]),
73 LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2])); 73 LOAD_INT(info.loads[2]), LOAD_FRAC(info.loads[2]));
74 74
75 return EXIT_SUCCESS; 75 return EXIT_SUCCESS;
diff --git a/scripts/config/Kconfig-language.txt b/scripts/config/Kconfig-language.txt
index a3037ffcf..493749b32 100644
--- a/scripts/config/Kconfig-language.txt
+++ b/scripts/config/Kconfig-language.txt
@@ -112,7 +112,7 @@ module state. Dependency expressions have the following syntax:
112 <expr> '||' <expr> (6) 112 <expr> '||' <expr> (6)
113 <expr> '&&' <expr> (7) 113 <expr> '&&' <expr> (7)
114 114
115Expressions are listed in decreasing order of precedence. 115Expressions are listed in decreasing order of precedence.
116 116
117(1) Convert the symbol into an expression. Boolean and tristate symbols 117(1) Convert the symbol into an expression. Boolean and tristate symbols
118 are simply converted into the respective expression values. All 118 are simply converted into the respective expression values. All
diff --git a/scripts/config/Makefile b/scripts/config/Makefile
index ab3df4993..e15ec399c 100644
--- a/scripts/config/Makefile
+++ b/scripts/config/Makefile
@@ -38,7 +38,7 @@ CONF_OBJS =$(patsubst %.c,%.o, $(CONF_SRC))
38MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC)) 38MCONF_OBJS=$(patsubst %.c,%.o, $(MCONF_SRC))
39SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC)) 39SHARED_OBJS=$(patsubst %.c,%.o, $(SHARED_SRC))
40 40
41conf: $(CONF_OBJS) $(SHARED_OBJS) 41conf: $(CONF_OBJS) $(SHARED_OBJS)
42 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@ 42 $(HOSTCC) $(NATIVE_LDFLAGS) $^ -o $@
43 43
44mconf: $(MCONF_OBJS) $(SHARED_OBJS) 44mconf: $(MCONF_OBJS) $(SHARED_OBJS)
@@ -55,7 +55,7 @@ lkc_defs.h: lkc_proto.h
55 55
56### 56###
57# The following requires flex/bison 57# The following requires flex/bison
58# By default we use the _shipped versions, uncomment the 58# By default we use the _shipped versions, uncomment the
59# following line if you are modifying the flex/bison src. 59# following line if you are modifying the flex/bison src.
60#LKC_GENPARSER := 1 60#LKC_GENPARSER := 1
61 61
diff --git a/scripts/config/checklist.c b/scripts/config/checklist.c
index c4a9289b9..9744d798d 100644
--- a/scripts/config/checklist.c
+++ b/scripts/config/checklist.c
@@ -120,7 +120,7 @@ int
120dialog_checklist (const char *title, const char *prompt, int height, int width, 120dialog_checklist (const char *title, const char *prompt, int height, int width,
121 int list_height, int item_no, struct dialog_list_item ** items, 121 int list_height, int item_no, struct dialog_list_item ** items,
122 int flag) 122 int flag)
123 123
124{ 124{
125 int i, x, y, box_x, box_y; 125 int i, x, y, box_x, box_y;
126 int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status; 126 int key = 0, button = 0, choice = 0, scroll = 0, max_choice, *status;
@@ -195,7 +195,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
195 195
196 /* Find length of longest item in order to center checklist */ 196 /* Find length of longest item in order to center checklist */
197 check_x = 0; 197 check_x = 0;
198 for (i = 0; i < item_no; i++) 198 for (i = 0; i < item_no; i++)
199 check_x = MAX (check_x, + strlen (items[i]->name) + 4); 199 check_x = MAX (check_x, + strlen (items[i]->name) + 4);
200 200
201 check_x = (list_width - check_x) / 2; 201 check_x = (list_width - check_x) / 2;
@@ -229,7 +229,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
229 break; 229 break;
230 230
231 231
232 if ( i < max_choice || key == KEY_UP || key == KEY_DOWN || 232 if ( i < max_choice || key == KEY_UP || key == KEY_DOWN ||
233 key == '+' || key == '-' ) { 233 key == '+' || key == '-' ) {
234 if (key == KEY_UP || key == '-') { 234 if (key == KEY_UP || key == '-') {
235 if (!choice) { 235 if (!choice) {
@@ -337,7 +337,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
337 } 337 }
338 wnoutrefresh (list); 338 wnoutrefresh (list);
339 wrefresh (dialog); 339 wrefresh (dialog);
340 340
341 for (i = 0; i < item_no; i++) { 341 for (i = 0; i < item_no; i++) {
342 items[i]->selected = status[i]; 342 items[i]->selected = status[i];
343 } 343 }
@@ -355,7 +355,7 @@ dialog_checklist (const char *title, const char *prompt, int height, int width,
355 /* Now, update everything... */ 355 /* Now, update everything... */
356 doupdate (); 356 doupdate ();
357 } 357 }
358 358
359 359
360 delwin (dialog); 360 delwin (dialog);
361 free (status); 361 free (status);
diff --git a/scripts/config/dialog.h b/scripts/config/dialog.h
index 8116cee36..6486cc8f7 100644
--- a/scripts/config/dialog.h
+++ b/scripts/config/dialog.h
@@ -86,7 +86,7 @@
86#define ACS_DARROW 'v' 86#define ACS_DARROW 'v'
87#endif 87#endif
88 88
89/* 89/*
90 * Attribute names 90 * Attribute names
91 */ 91 */
92#define screen_attr attributes[0] 92#define screen_attr attributes[0]
@@ -162,7 +162,7 @@ int dialog_msgbox (const char *title, const char *prompt, int height,
162 int width, int pause); 162 int width, int pause);
163int dialog_textbox (const char *title, const char *file, int height, int width); 163int dialog_textbox (const char *title, const char *file, int height, int width);
164int dialog_menu (const char *title, const char *prompt, int height, int width, 164int dialog_menu (const char *title, const char *prompt, int height, int width,
165 int menu_height, const char *choice, int item_no, 165 int menu_height, const char *choice, int item_no,
166 struct dialog_list_item ** items); 166 struct dialog_list_item ** items);
167int dialog_checklist (const char *title, const char *prompt, int height, 167int dialog_checklist (const char *title, const char *prompt, int height,
168 int width, int list_height, int item_no, 168 int width, int list_height, int item_no,
diff --git a/scripts/config/lex.zconf.c_shipped b/scripts/config/lex.zconf.c_shipped
index 22dda11f7..b877bb6b3 100644
--- a/scripts/config/lex.zconf.c_shipped
+++ b/scripts/config/lex.zconf.c_shipped
@@ -42,7 +42,7 @@ typedef uint32_t flex_uint32_t;
42typedef signed char flex_int8_t; 42typedef signed char flex_int8_t;
43typedef short int flex_int16_t; 43typedef short int flex_int16_t;
44typedef int flex_int32_t; 44typedef int flex_int32_t;
45typedef unsigned char flex_uint8_t; 45typedef unsigned char flex_uint8_t;
46typedef unsigned short int flex_uint16_t; 46typedef unsigned short int flex_uint16_t;
47typedef unsigned int flex_uint32_t; 47typedef unsigned int flex_uint32_t;
48#endif /* ! C99 */ 48#endif /* ! C99 */
@@ -148,7 +148,7 @@ extern FILE *zconfin, *zconfout;
148#define EOB_ACT_LAST_MATCH 2 148#define EOB_ACT_LAST_MATCH 2
149 149
150 #define YY_LESS_LINENO(n) 150 #define YY_LESS_LINENO(n)
151 151
152/* Return all but the first "n" matched characters back to the input stream. */ 152/* Return all but the first "n" matched characters back to the input stream. */
153#define yyless(n) \ 153#define yyless(n) \
154 do \ 154 do \
@@ -215,7 +215,7 @@ struct yy_buffer_state
215 215
216 int yy_bs_lineno; /**< The line count. */ 216 int yy_bs_lineno; /**< The line count. */
217 int yy_bs_column; /**< The column count. */ 217 int yy_bs_column; /**< The column count. */
218 218
219 /* Whether to try to fill the input buffer when we reach the 219 /* Whether to try to fill the input buffer when we reach the
220 * end of it. 220 * end of it.
221 */ 221 */
@@ -2089,7 +2089,7 @@ extern int zconfwrap (void );
2089#endif 2089#endif
2090 2090
2091 static void yyunput (int c,char *buf_ptr ); 2091 static void yyunput (int c,char *buf_ptr );
2092 2092
2093#ifndef yytext_ptr 2093#ifndef yytext_ptr
2094static void yy_flex_strncpy (char *,yyconst char *,int ); 2094static void yy_flex_strncpy (char *,yyconst char *,int );
2095#endif 2095#endif
@@ -2194,7 +2194,7 @@ YY_DECL
2194 register yy_state_type yy_current_state; 2194 register yy_state_type yy_current_state;
2195 register char *yy_cp, *yy_bp; 2195 register char *yy_cp, *yy_bp;
2196 register int yy_act; 2196 register int yy_act;
2197 2197
2198 int str = 0; 2198 int str = 0;
2199 int ts, i; 2199 int ts, i;
2200 2200
@@ -2899,7 +2899,7 @@ static int yy_get_next_buffer (void)
2899{ 2899{
2900 register yy_state_type yy_current_state; 2900 register yy_state_type yy_current_state;
2901 register char *yy_cp; 2901 register char *yy_cp;
2902 2902
2903 yy_current_state = (yy_start); 2903 yy_current_state = (yy_start);
2904 2904
2905 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) 2905 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
@@ -2918,7 +2918,7 @@ static int yy_get_next_buffer (void)
2918 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) 2918 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
2919{ 2919{
2920 register int yy_is_jam; 2920 register int yy_is_jam;
2921 2921
2922 yy_current_state = yy_nxt[yy_current_state][1]; 2922 yy_current_state = yy_nxt[yy_current_state][1];
2923 yy_is_jam = (yy_current_state <= 0); 2923 yy_is_jam = (yy_current_state <= 0);
2924 2924
@@ -2928,7 +2928,7 @@ static int yy_get_next_buffer (void)
2928 static void yyunput (int c, register char * yy_bp ) 2928 static void yyunput (int c, register char * yy_bp )
2929{ 2929{
2930 register char *yy_cp; 2930 register char *yy_cp;
2931 2931
2932 yy_cp = (yy_c_buf_p); 2932 yy_cp = (yy_c_buf_p);
2933 2933
2934 /* undo effects of setting up zconftext */ 2934 /* undo effects of setting up zconftext */
@@ -2971,7 +2971,7 @@ static int yy_get_next_buffer (void)
2971 2971
2972{ 2972{
2973 int c; 2973 int c;
2974 2974
2975 *(yy_c_buf_p) = (yy_hold_char); 2975 *(yy_c_buf_p) = (yy_hold_char);
2976 2976
2977 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) 2977 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
@@ -3038,12 +3038,12 @@ static int yy_get_next_buffer (void)
3038 3038
3039/** Immediately switch to a different input stream. 3039/** Immediately switch to a different input stream.
3040 * @param input_file A readable stream. 3040 * @param input_file A readable stream.
3041 * 3041 *
3042 * @note This function does not reset the start condition to @c INITIAL . 3042 * @note This function does not reset the start condition to @c INITIAL .
3043 */ 3043 */
3044 void zconfrestart (FILE * input_file ) 3044 void zconfrestart (FILE * input_file )
3045{ 3045{
3046 3046
3047 if ( ! YY_CURRENT_BUFFER ){ 3047 if ( ! YY_CURRENT_BUFFER ){
3048 zconfensure_buffer_stack (); 3048 zconfensure_buffer_stack ();
3049 YY_CURRENT_BUFFER_LVALUE = 3049 YY_CURRENT_BUFFER_LVALUE =
@@ -3056,11 +3056,11 @@ static int yy_get_next_buffer (void)
3056 3056
3057/** Switch to a different input buffer. 3057/** Switch to a different input buffer.
3058 * @param new_buffer The new input buffer. 3058 * @param new_buffer The new input buffer.
3059 * 3059 *
3060 */ 3060 */
3061 void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer ) 3061 void zconf_switch_to_buffer (YY_BUFFER_STATE new_buffer )
3062{ 3062{
3063 3063
3064 /* TODO. We should be able to replace this entire function body 3064 /* TODO. We should be able to replace this entire function body
3065 * with 3065 * with
3066 * zconfpop_buffer_state(); 3066 * zconfpop_buffer_state();
@@ -3100,13 +3100,13 @@ static void zconf_load_buffer_state (void)
3100/** Allocate and initialize an input buffer state. 3100/** Allocate and initialize an input buffer state.
3101 * @param file A readable stream. 3101 * @param file A readable stream.
3102 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. 3102 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
3103 * 3103 *
3104 * @return the allocated buffer state. 3104 * @return the allocated buffer state.
3105 */ 3105 */
3106 YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size ) 3106 YY_BUFFER_STATE zconf_create_buffer (FILE * file, int size )
3107{ 3107{
3108 YY_BUFFER_STATE b; 3108 YY_BUFFER_STATE b;
3109 3109
3110 b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) ); 3110 b = (YY_BUFFER_STATE) zconfalloc(sizeof( struct yy_buffer_state ) );
3111 if ( ! b ) 3111 if ( ! b )
3112 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" ); 3112 YY_FATAL_ERROR( "out of dynamic memory in zconf_create_buffer()" );
@@ -3129,11 +3129,11 @@ static void zconf_load_buffer_state (void)
3129 3129
3130/** Destroy the buffer. 3130/** Destroy the buffer.
3131 * @param b a buffer created with zconf_create_buffer() 3131 * @param b a buffer created with zconf_create_buffer()
3132 * 3132 *
3133 */ 3133 */
3134 void zconf_delete_buffer (YY_BUFFER_STATE b ) 3134 void zconf_delete_buffer (YY_BUFFER_STATE b )
3135{ 3135{
3136 3136
3137 if ( ! b ) 3137 if ( ! b )
3138 return; 3138 return;
3139 3139
@@ -3154,7 +3154,7 @@ static void zconf_load_buffer_state (void)
3154 3154
3155{ 3155{
3156 int oerrno = errno; 3156 int oerrno = errno;
3157 3157
3158 zconf_flush_buffer(b ); 3158 zconf_flush_buffer(b );
3159 3159
3160 b->yy_input_file = file; 3160 b->yy_input_file = file;
@@ -3170,13 +3170,13 @@ static void zconf_load_buffer_state (void)
3170 } 3170 }
3171 3171
3172 b->yy_is_interactive = 0; 3172 b->yy_is_interactive = 0;
3173 3173
3174 errno = oerrno; 3174 errno = oerrno;
3175} 3175}
3176 3176
3177/** Discard all buffered characters. On the next scan, YY_INPUT will be called. 3177/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
3178 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. 3178 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
3179 * 3179 *
3180 */ 3180 */
3181 void zconf_flush_buffer (YY_BUFFER_STATE b ) 3181 void zconf_flush_buffer (YY_BUFFER_STATE b )
3182{ 3182{
@@ -3205,7 +3205,7 @@ static void zconf_load_buffer_state (void)
3205 * the current state. This function will allocate the stack 3205 * the current state. This function will allocate the stack
3206 * if necessary. 3206 * if necessary.
3207 * @param new_buffer The new state. 3207 * @param new_buffer The new state.
3208 * 3208 *
3209 */ 3209 */
3210void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer ) 3210void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
3211{ 3211{
@@ -3235,7 +3235,7 @@ void zconfpush_buffer_state (YY_BUFFER_STATE new_buffer )
3235 3235
3236/** Removes and deletes the top of the stack, if present. 3236/** Removes and deletes the top of the stack, if present.
3237 * The next element becomes the new top. 3237 * The next element becomes the new top.
3238 * 3238 *
3239 */ 3239 */
3240void zconfpop_buffer_state (void) 3240void zconfpop_buffer_state (void)
3241{ 3241{
@@ -3259,7 +3259,7 @@ void zconfpop_buffer_state (void)
3259static void zconfensure_buffer_stack (void) 3259static void zconfensure_buffer_stack (void)
3260{ 3260{
3261 int num_to_alloc; 3261 int num_to_alloc;
3262 3262
3263 if (!(yy_buffer_stack)) { 3263 if (!(yy_buffer_stack)) {
3264 3264
3265 /* First allocation is just for 2 elements, since we don't know if this 3265 /* First allocation is just for 2 elements, since we don't know if this
@@ -3270,9 +3270,9 @@ static void zconfensure_buffer_stack (void)
3270 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc 3270 (yy_buffer_stack) = (struct yy_buffer_state**)zconfalloc
3271 (num_to_alloc * sizeof(struct yy_buffer_state*) 3271 (num_to_alloc * sizeof(struct yy_buffer_state*)
3272 ); 3272 );
3273 3273
3274 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); 3274 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
3275 3275
3276 (yy_buffer_stack_max) = num_to_alloc; 3276 (yy_buffer_stack_max) = num_to_alloc;
3277 (yy_buffer_stack_top) = 0; 3277 (yy_buffer_stack_top) = 0;
3278 return; 3278 return;
@@ -3298,13 +3298,13 @@ static void zconfensure_buffer_stack (void)
3298/** Setup the input buffer state to scan directly from a user-specified character buffer. 3298/** Setup the input buffer state to scan directly from a user-specified character buffer.
3299 * @param base the character buffer 3299 * @param base the character buffer
3300 * @param size the size in bytes of the character buffer 3300 * @param size the size in bytes of the character buffer
3301 * 3301 *
3302 * @return the newly allocated buffer state object. 3302 * @return the newly allocated buffer state object.
3303 */ 3303 */
3304YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size ) 3304YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
3305{ 3305{
3306 YY_BUFFER_STATE b; 3306 YY_BUFFER_STATE b;
3307 3307
3308 if ( size < 2 || 3308 if ( size < 2 ||
3309 base[size-2] != YY_END_OF_BUFFER_CHAR || 3309 base[size-2] != YY_END_OF_BUFFER_CHAR ||
3310 base[size-1] != YY_END_OF_BUFFER_CHAR ) 3310 base[size-1] != YY_END_OF_BUFFER_CHAR )
@@ -3333,14 +3333,14 @@ YY_BUFFER_STATE zconf_scan_buffer (char * base, yy_size_t size )
3333/** Setup the input buffer state to scan a string. The next call to zconflex() will 3333/** Setup the input buffer state to scan a string. The next call to zconflex() will
3334 * scan from a @e copy of @a str. 3334 * scan from a @e copy of @a str.
3335 * @param str a NUL-terminated string to scan 3335 * @param str a NUL-terminated string to scan
3336 * 3336 *
3337 * @return the newly allocated buffer state object. 3337 * @return the newly allocated buffer state object.
3338 * @note If you want to scan bytes that may contain NUL values, then use 3338 * @note If you want to scan bytes that may contain NUL values, then use
3339 * zconf_scan_bytes() instead. 3339 * zconf_scan_bytes() instead.
3340 */ 3340 */
3341YY_BUFFER_STATE zconf_scan_string (yyconst char * str ) 3341YY_BUFFER_STATE zconf_scan_string (yyconst char * str )
3342{ 3342{
3343 3343
3344 return zconf_scan_bytes(str,strlen(str) ); 3344 return zconf_scan_bytes(str,strlen(str) );
3345} 3345}
3346 3346
@@ -3348,7 +3348,7 @@ YY_BUFFER_STATE zconf_scan_string (yyconst char * str )
3348 * scan from a @e copy of @a bytes. 3348 * scan from a @e copy of @a bytes.
3349 * @param bytes the byte buffer to scan 3349 * @param bytes the byte buffer to scan
3350 * @param len the number of bytes in the buffer pointed to by @a bytes. 3350 * @param len the number of bytes in the buffer pointed to by @a bytes.
3351 * 3351 *
3352 * @return the newly allocated buffer state object. 3352 * @return the newly allocated buffer state object.
3353 */ 3353 */
3354YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len ) 3354YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len )
@@ -3357,7 +3357,7 @@ YY_BUFFER_STATE zconf_scan_bytes (yyconst char * bytes, int len )
3357 char *buf; 3357 char *buf;
3358 yy_size_t n; 3358 yy_size_t n;
3359 int i; 3359 int i;
3360 3360
3361 /* Get memory for full buffer, including space for trailing EOB's. */ 3361 /* Get memory for full buffer, including space for trailing EOB's. */
3362 n = len + 2; 3362 n = len + 2;
3363 buf = (char *) zconfalloc(n ); 3363 buf = (char *) zconfalloc(n );
@@ -3411,16 +3411,16 @@ static void yy_fatal_error (yyconst char* msg )
3411/* Accessor methods (get/set functions) to struct members. */ 3411/* Accessor methods (get/set functions) to struct members. */
3412 3412
3413/** Get the current line number. 3413/** Get the current line number.
3414 * 3414 *
3415 */ 3415 */
3416int zconfget_lineno (void) 3416int zconfget_lineno (void)
3417{ 3417{
3418 3418
3419 return zconflineno; 3419 return zconflineno;
3420} 3420}
3421 3421
3422/** Get the input stream. 3422/** Get the input stream.
3423 * 3423 *
3424 */ 3424 */
3425FILE *zconfget_in (void) 3425FILE *zconfget_in (void)
3426{ 3426{
@@ -3428,7 +3428,7 @@ FILE *zconfget_in (void)
3428} 3428}
3429 3429
3430/** Get the output stream. 3430/** Get the output stream.
3431 * 3431 *
3432 */ 3432 */
3433FILE *zconfget_out (void) 3433FILE *zconfget_out (void)
3434{ 3434{
@@ -3436,7 +3436,7 @@ FILE *zconfget_out (void)
3436} 3436}
3437 3437
3438/** Get the length of the current token. 3438/** Get the length of the current token.
3439 * 3439 *
3440 */ 3440 */
3441int zconfget_leng (void) 3441int zconfget_leng (void)
3442{ 3442{
@@ -3444,7 +3444,7 @@ int zconfget_leng (void)
3444} 3444}
3445 3445
3446/** Get the current token. 3446/** Get the current token.
3447 * 3447 *
3448 */ 3448 */
3449 3449
3450char *zconfget_text (void) 3450char *zconfget_text (void)
@@ -3454,18 +3454,18 @@ char *zconfget_text (void)
3454 3454
3455/** Set the current line number. 3455/** Set the current line number.
3456 * @param line_number 3456 * @param line_number
3457 * 3457 *
3458 */ 3458 */
3459void zconfset_lineno (int line_number ) 3459void zconfset_lineno (int line_number )
3460{ 3460{
3461 3461
3462 zconflineno = line_number; 3462 zconflineno = line_number;
3463} 3463}
3464 3464
3465/** Set the input stream. This does not discard the current 3465/** Set the input stream. This does not discard the current
3466 * input buffer. 3466 * input buffer.
3467 * @param in_str A readable stream. 3467 * @param in_str A readable stream.
3468 * 3468 *
3469 * @see zconf_switch_to_buffer 3469 * @see zconf_switch_to_buffer
3470 */ 3470 */
3471void zconfset_in (FILE * in_str ) 3471void zconfset_in (FILE * in_str )
@@ -3491,7 +3491,7 @@ void zconfset_debug (int bdebug )
3491/* zconflex_destroy is for both reentrant and non-reentrant scanners. */ 3491/* zconflex_destroy is for both reentrant and non-reentrant scanners. */
3492int zconflex_destroy (void) 3492int zconflex_destroy (void)
3493{ 3493{
3494 3494
3495 /* Pop the buffer stack, destroying each element. */ 3495 /* Pop the buffer stack, destroying each element. */
3496 while(YY_CURRENT_BUFFER){ 3496 while(YY_CURRENT_BUFFER){
3497 zconf_delete_buffer(YY_CURRENT_BUFFER ); 3497 zconf_delete_buffer(YY_CURRENT_BUFFER );
diff --git a/scripts/config/mconf.c b/scripts/config/mconf.c
index 739b3b480..fe4562b17 100644
--- a/scripts/config/mconf.c
+++ b/scripts/config/mconf.c
@@ -169,7 +169,7 @@ static void cmake(void)
169 items[item_no]->namelen = 0; 169 items[item_no]->namelen = 0;
170 item_no++; 170 item_no++;
171} 171}
172 172
173static int cprint_name(const char *fmt, ...) 173static int cprint_name(const char *fmt, ...)
174{ 174{
175 va_list ap; 175 va_list ap;
@@ -186,7 +186,7 @@ static int cprint_name(const char *fmt, ...)
186 186
187 return res; 187 return res;
188} 188}
189 189
190static int cprint_tag(const char *fmt, ...) 190static int cprint_tag(const char *fmt, ...)
191{ 191{
192 va_list ap; 192 va_list ap;
@@ -200,7 +200,7 @@ static int cprint_tag(const char *fmt, ...)
200 200
201 return res; 201 return res;
202} 202}
203 203
204static void cdone(void) 204static void cdone(void)
205{ 205{
206 int i; 206 int i;
@@ -675,19 +675,19 @@ int main(int ac, char **av)
675 if (!strcasecmp(mode, "single_menu")) 675 if (!strcasecmp(mode, "single_menu"))
676 single_menu_mode = 1; 676 single_menu_mode = 1;
677 } 677 }
678 678
679 tcgetattr(1, &ios_org); 679 tcgetattr(1, &ios_org);
680 atexit(conf_cleanup); 680 atexit(conf_cleanup);
681 init_wsize(); 681 init_wsize();
682 init_dialog(); 682 init_dialog();
683 signal(SIGWINCH, winch_handler); 683 signal(SIGWINCH, winch_handler);
684 conf(&rootmenu); 684 conf(&rootmenu);
685 end_dialog(); 685 end_dialog();
686 686
687 /* Restart dialog to act more like when lxdialog was still separate */ 687 /* Restart dialog to act more like when lxdialog was still separate */
688 init_dialog(); 688 init_dialog();
689 do { 689 do {
690 stat = dialog_yesno(NULL, 690 stat = dialog_yesno(NULL,
691 "Do you wish to save your new BusyBox configuration?", 5, 60); 691 "Do you wish to save your new BusyBox configuration?", 5, 60);
692 } while (stat < 0); 692 } while (stat < 0);
693 end_dialog(); 693 end_dialog();
diff --git a/scripts/config/menu.c b/scripts/config/menu.c
index 6e075f80b..9b8d389e6 100644
--- a/scripts/config/menu.c
+++ b/scripts/config/menu.c
@@ -228,7 +228,7 @@ void menu_finalize(struct menu *parent)
228 if (prop->type == P_PROMPT && prop->menu != menu) { 228 if (prop->type == P_PROMPT && prop->menu != menu) {
229 fprintf(stderr, "%s:%d:warning: choice values currently only support a single prompt\n", 229 fprintf(stderr, "%s:%d:warning: choice values currently only support a single prompt\n",
230 prop->file->name, prop->lineno); 230 prop->file->name, prop->lineno);
231 231
232 } 232 }
233 if (prop->type == P_DEFAULT) 233 if (prop->type == P_DEFAULT)
234 fprintf(stderr, "%s:%d:warning: defaults for choice values not supported\n", 234 fprintf(stderr, "%s:%d:warning: defaults for choice values not supported\n",
diff --git a/scripts/config/menubox.c b/scripts/config/menubox.c
index 18e02168b..431f09fc9 100644
--- a/scripts/config/menubox.c
+++ b/scripts/config/menubox.c
@@ -26,7 +26,7 @@
26 * 26 *
27 * *) A bugfix for the Page-Down problem 27 * *) A bugfix for the Page-Down problem
28 * 28 *
29 * *) Formerly when I used Page Down and Page Up, the cursor would be set 29 * *) Formerly when I used Page Down and Page Up, the cursor would be set
30 * to the first position in the menu box. Now lxdialog is a bit 30 * to the first position in the menu box. Now lxdialog is a bit
31 * smarter and works more like other menu systems (just have a look at 31 * smarter and works more like other menu systems (just have a look at
32 * it). 32 * it).
@@ -225,7 +225,7 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
225 225
226 /* 226 /*
227 * Find length of longest item in order to center menu. 227 * Find length of longest item in order to center menu.
228 * Set 'choice' to default item. 228 * Set 'choice' to default item.
229 */ 229 */
230 item_x = 0; 230 item_x = 0;
231 for (i = 0; i < item_no; i++) { 231 for (i = 0; i < item_no; i++) {
@@ -294,7 +294,7 @@ dialog_menu (const char *title, const char *prompt, int height, int width,
294 } 294 }
295 } 295 }
296 296
297 if (i < max_choice || 297 if (i < max_choice ||
298 key == KEY_UP || key == KEY_DOWN || 298 key == KEY_UP || key == KEY_DOWN ||
299 key == '-' || key == '+' || 299 key == '-' || key == '+' ||
300 key == KEY_PPAGE || key == KEY_NPAGE) { 300 key == KEY_PPAGE || key == KEY_NPAGE) {
diff --git a/scripts/config/util.c b/scripts/config/util.c
index d20730b88..104ff0e4c 100644
--- a/scripts/config/util.c
+++ b/scripts/config/util.c
@@ -29,7 +29,7 @@ char *backtitle = NULL;
29 29
30const char *dialog_result; 30const char *dialog_result;
31 31
32/* 32/*
33 * Attribute values, default is for mono display 33 * Attribute values, default is for mono display
34 */ 34 */
35chtype attributes[] = 35chtype attributes[] =
@@ -204,7 +204,7 @@ print_autowrap (WINDOW * win, const char *prompt, int width, int y, int x)
204 strcpy (tempstr, prompt); 204 strcpy (tempstr, prompt);
205 205
206 prompt_len = strlen(tempstr); 206 prompt_len = strlen(tempstr);
207 207
208 /* 208 /*
209 * Remove newlines 209 * Remove newlines
210 */ 210 */
@@ -350,7 +350,7 @@ first_alpha(const char *string, const char *exempt)
350 if (strchr("<[(", c)) ++in_paren; 350 if (strchr("<[(", c)) ++in_paren;
351 if (strchr(">])", c)) --in_paren; 351 if (strchr(">])", c)) --in_paren;
352 352
353 if ((! in_paren) && isalpha(c) && 353 if ((! in_paren) && isalpha(c) &&
354 strchr(exempt, c) == 0) 354 strchr(exempt, c) == 0)
355 return i; 355 return i;
356 } 356 }
diff --git a/scripts/config/zconf.tab.c_shipped b/scripts/config/zconf.tab.c_shipped
index 4f5bcfb45..a5f69a026 100644
--- a/scripts/config/zconf.tab.c_shipped
+++ b/scripts/config/zconf.tab.c_shipped
@@ -446,21 +446,21 @@ static const unsigned short yyrline[] =
446 First, the terminals, then, starting at YYNTOKENS, nonterminals. */ 446 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
447static const char *const yytname[] = 447static const char *const yytname[] =
448{ 448{
449 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU", 449 "$end", "error", "$undefined", "T_MAINMENU", "T_MENU", "T_ENDMENU",
450 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", 450 "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG",
451 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", 451 "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS",
452 "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE", 452 "T_REQUIRES", "T_OPTIONAL", "T_PROMPT", "T_DEFAULT", "T_TRISTATE",
453 "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT", 453 "T_DEF_TRISTATE", "T_BOOLEAN", "T_DEF_BOOLEAN", "T_STRING", "T_INT",
454 "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL", 454 "T_HEX", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", "T_EOF", "T_EOL",
455 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR", 455 "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_ON", "T_SELECT", "T_RANGE", "T_OR",
456 "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block", 456 "T_AND", "T_EQUAL", "T_NOT", "$accept", "input", "block",
457 "common_block", "config_entry_start", "config_stmt", 457 "common_block", "config_entry_start", "config_stmt",
458 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list", 458 "menuconfig_entry_start", "menuconfig_stmt", "config_option_list",
459 "config_option", "choice", "choice_entry", "choice_end", "choice_stmt", 459 "config_option", "choice", "choice_entry", "choice_end", "choice_stmt",
460 "choice_option_list", "choice_option", "choice_block", "if", "if_end", 460 "choice_option_list", "choice_option", "choice_block", "if", "if_end",
461 "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt", 461 "if_stmt", "if_block", "menu", "menu_entry", "menu_end", "menu_stmt",
462 "menu_block", "source", "source_stmt", "comment", "comment_stmt", 462 "menu_block", "source", "source_stmt", "comment", "comment_stmt",
463 "help_start", "help", "depends_list", "depends", "prompt_stmt_opt", 463 "help_start", "help", "depends_list", "depends", "prompt_stmt_opt",
464 "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0 464 "prompt", "end", "nl_or_eof", "if_expr", "expr", "symbol", 0
465}; 465};
466#endif 466#endif
@@ -1027,7 +1027,7 @@ yyparse ()
1027#endif 1027#endif
1028#endif 1028#endif
1029{ 1029{
1030 1030
1031 register int yystate; 1031 register int yystate;
1032 register int yyn; 1032 register int yyn;
1033 int yyresult; 1033 int yyresult;
diff --git a/scripts/mkdep.c b/scripts/mkdep.c
index 9b92b08c4..ae3cc74e0 100644
--- a/scripts/mkdep.c
+++ b/scripts/mkdep.c
@@ -3,7 +3,7 @@
3 * Smart CONFIG_* processing by Werner Almesberger, Michael Chastain. 3 * Smart CONFIG_* processing by Werner Almesberger, Michael Chastain.
4 * 4 *
5 * Usage: mkdep cflags -- file ... 5 * Usage: mkdep cflags -- file ...
6 * 6 *
7 * Read source files and output makefile dependency lines for them. 7 * Read source files and output makefile dependency lines for them.
8 * I make simple dependency lines for #include <*.h> and #include "*.h". 8 * I make simple dependency lines for #include <*.h> and #include "*.h".
9 * I also find instances of CONFIG_FOO and generate dependencies 9 * I also find instances of CONFIG_FOO and generate dependencies
diff --git a/scripts/split-include.c b/scripts/split-include.c
index 3ab9fed87..624a0d62b 100644
--- a/scripts/split-include.c
+++ b/scripts/split-include.c
@@ -96,7 +96,7 @@ int main(int argc, const char * argv [])
96 /* Change to output directory. */ 96 /* Change to output directory. */
97 if (chdir(str_dir_config) != 0) 97 if (chdir(str_dir_config) != 0)
98 ERROR_EXIT(str_dir_config); 98 ERROR_EXIT(str_dir_config);
99 99
100 /* Put initial separator into target list. */ 100 /* Put initial separator into target list. */
101 ptarget = list_target; 101 ptarget = list_target;
102 *ptarget++ = '\n'; 102 *ptarget++ = '\n';
diff --git a/shell/Config.in b/shell/Config.in
index 892b96e78..bcb5e719b 100644
--- a/shell/Config.in
+++ b/shell/Config.in
@@ -41,7 +41,7 @@ config CONFIG_ASH
41 the most complete and most pedantically correct shell included with 41 the most complete and most pedantically correct shell included with
42 busybox. This shell is actually a derivative of the Debian 'dash' 42 busybox. This shell is actually a derivative of the Debian 'dash'
43 shell (by Herbert Xu), which was created by porting the 'ash' shell 43 shell (by Herbert Xu), which was created by porting the 'ash' shell
44 (written by Kenneth Almquist) from NetBSD. 44 (written by Kenneth Almquist) from NetBSD.
45 45
46comment "Ash Shell Options" 46comment "Ash Shell Options"
47 depends on CONFIG_ASH 47 depends on CONFIG_ASH
diff --git a/shell/Makefile b/shell/Makefile
index a08219262..8f476c19e 100644
--- a/shell/Makefile
+++ b/shell/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/shell/Makefile.in b/shell/Makefile.in
index c5be7ba79..7b9f41ed4 100644
--- a/shell/Makefile.in
+++ b/shell/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/shell/ash.c b/shell/ash.c
index 8c2493ece..060860c07 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7615,7 +7615,7 @@ cmdputs(const char *s)
7615 int quoted = 0; 7615 int quoted = 0;
7616 static const char *const vstype[16] = { 7616 static const char *const vstype[16] = {
7617 nullstr, "}", "-", "+", "?", "=", 7617 nullstr, "}", "-", "+", "?", "=",
7618 "%", "%%", "#", "##", nullstr 7618 "%", "%%", "#", "##", nullstr
7619 }; 7619 };
7620 7620
7621 nextc = makestrspace((strlen(s) + 1) * 8, cmdnextc); 7621 nextc = makestrspace((strlen(s) + 1) * 8, cmdnextc);
diff --git a/shell/hush.c b/shell/hush.c
index 84818ffa3..5da975746 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -12,7 +12,7 @@
12 * written Dec 2000 and Jan 2001 by Larry Doolittle. The 12 * written Dec 2000 and Jan 2001 by Larry Doolittle. The
13 * execution engine, the builtins, and much of the underlying 13 * execution engine, the builtins, and much of the underlying
14 * support has been adapted from busybox-0.49pre's lash, which is 14 * support has been adapted from busybox-0.49pre's lash, which is
15 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 15 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
16 * written by Erik Andersen <andersen@codepoet.org>. That, in turn, 16 * written by Erik Andersen <andersen@codepoet.org>. That, in turn,
17 * is based in part on ladsh.c, by Michael K. Johnson and Erik W. 17 * is based in part on ladsh.c, by Michael K. Johnson and Erik W.
18 * Troan, which they placed in the public domain. I don't know 18 * Troan, which they placed in the public domain. I don't know
@@ -197,7 +197,7 @@ struct redir_struct {
197 redir_type type; /* type of redirection */ 197 redir_type type; /* type of redirection */
198 int fd; /* file descriptor being redirected */ 198 int fd; /* file descriptor being redirected */
199 int dup; /* -1, or file descriptor being duplicated */ 199 int dup; /* -1, or file descriptor being duplicated */
200 struct redir_struct *next; /* pointer to the next redirect in the list */ 200 struct redir_struct *next; /* pointer to the next redirect in the list */
201 glob_t word; /* *word.gl_pathv is the filename */ 201 glob_t word; /* *word.gl_pathv is the filename */
202}; 202};
203 203
@@ -248,7 +248,7 @@ char **global_argv;
248unsigned int global_argc; 248unsigned int global_argc;
249unsigned int last_return_code; 249unsigned int last_return_code;
250extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ 250extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */
251 251
252/* "globals" within this file */ 252/* "globals" within this file */
253static char *ifs; 253static char *ifs;
254static char map[256]; 254static char map[256];
@@ -421,7 +421,7 @@ static struct built_in_command bltins[] = {
421 {"continue", "Continue for, while or until loop", builtin_not_written}, 421 {"continue", "Continue for, while or until loop", builtin_not_written},
422 {"env", "Print all environment variables", builtin_env}, 422 {"env", "Print all environment variables", builtin_env},
423 {"eval", "Construct and run shell command", builtin_eval}, 423 {"eval", "Construct and run shell command", builtin_eval},
424 {"exec", "Exec command, replacing this shell with the exec'd process", 424 {"exec", "Exec command, replacing this shell with the exec'd process",
425 builtin_exec}, 425 builtin_exec},
426 {"exit", "Exit from shell()", builtin_exit}, 426 {"exit", "Exit from shell()", builtin_exit},
427 {"export", "Set environment variable", builtin_export}, 427 {"export", "Set environment variable", builtin_export},
@@ -456,10 +456,10 @@ static int builtin_eval(struct child_prog *child)
456{ 456{
457 char *str = NULL; 457 char *str = NULL;
458 int rcode = EXIT_SUCCESS; 458 int rcode = EXIT_SUCCESS;
459 459
460 if (child->argv[1]) { 460 if (child->argv[1]) {
461 str = make_string(child->argv + 1); 461 str = make_string(child->argv + 1);
462 parse_string_outer(str, FLAG_EXIT_FROM_LOOP | 462 parse_string_outer(str, FLAG_EXIT_FROM_LOOP |
463 FLAG_PARSE_SEMICOLON); 463 FLAG_PARSE_SEMICOLON);
464 free(str); 464 free(str);
465 rcode = last_return_code; 465 rcode = last_return_code;
@@ -873,7 +873,7 @@ static inline void cmdedit_set_initial_prompt(void)
873 PS1 = getenv("PS1"); 873 PS1 = getenv("PS1");
874 if(PS1==0) 874 if(PS1==0)
875 PS1 = "\\w \\$ "; 875 PS1 = "\\w \\$ ";
876#endif 876#endif
877} 877}
878 878
879static inline void setup_prompt_string(int promptmode, char **prompt_str) 879static inline void setup_prompt_string(int promptmode, char **prompt_str)
@@ -919,7 +919,7 @@ static void get_user_input(struct in_str *i)
919 i->p = the_command; 919 i->p = the_command;
920} 920}
921 921
922/* This is the magic location that prints prompts 922/* This is the magic location that prints prompts
923 * and gets data back from the user */ 923 * and gets data back from the user */
924static int file_get(struct in_str *i) 924static int file_get(struct in_str *i)
925{ 925{
@@ -1110,14 +1110,14 @@ static void pseudo_exec(struct child_prog *child)
1110 } 1110 }
1111 1111
1112 /* Check if the command matches any busybox internal commands 1112 /* Check if the command matches any busybox internal commands
1113 * ("applets") here. 1113 * ("applets") here.
1114 * FIXME: This feature is not 100% safe, since 1114 * FIXME: This feature is not 100% safe, since
1115 * BusyBox is not fully reentrant, so we have no guarantee the things 1115 * BusyBox is not fully reentrant, so we have no guarantee the things
1116 * from the .bss are still zeroed, or that things from .data are still 1116 * from the .bss are still zeroed, or that things from .data are still
1117 * at their defaults. We could exec ourself from /proc/self/exe, but I 1117 * at their defaults. We could exec ourself from /proc/self/exe, but I
1118 * really dislike relying on /proc for things. We could exec ourself 1118 * really dislike relying on /proc for things. We could exec ourself
1119 * from global_argv[0], but if we are in a chroot, we may not be able 1119 * from global_argv[0], but if we are in a chroot, we may not be able
1120 * to find ourself... */ 1120 * to find ourself... */
1121#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL 1121#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
1122 { 1122 {
1123 int argc_l; 1123 int argc_l;
@@ -1196,7 +1196,7 @@ static void insert_bg_job(struct pipe *pi)
1196 } 1196 }
1197 } 1197 }
1198 1198
1199 /* we don't wait for background thejobs to return -- append it 1199 /* we don't wait for background thejobs to return -- append it
1200 to the list of backgrounded thejobs and leave it alone */ 1200 to the list of backgrounded thejobs and leave it alone */
1201 printf("[%d] %d\n", thejob->jobid, thejob->progs[0].pid); 1201 printf("[%d] %d\n", thejob->jobid, thejob->progs[0].pid);
1202 last_bg_pid = thejob->progs[0].pid; 1202 last_bg_pid = thejob->progs[0].pid;
@@ -1226,7 +1226,7 @@ static void remove_bg_job(struct pipe *pi)
1226 free(pi); 1226 free(pi);
1227} 1227}
1228 1228
1229/* Checks to see if any processes have exited -- if they 1229/* Checks to see if any processes have exited -- if they
1230 have, figure out why and see if a job has completed */ 1230 have, figure out why and see if a job has completed */
1231static int checkjobs(struct pipe* fg_pipe) 1231static int checkjobs(struct pipe* fg_pipe)
1232{ 1232{
@@ -1246,7 +1246,7 @@ static int checkjobs(struct pipe* fg_pipe)
1246 int i, rcode = 0; 1246 int i, rcode = 0;
1247 for (i=0; i < fg_pipe->num_progs; i++) { 1247 for (i=0; i < fg_pipe->num_progs; i++) {
1248 if (fg_pipe->progs[i].pid == childpid) { 1248 if (fg_pipe->progs[i].pid == childpid) {
1249 if (i==fg_pipe->num_progs-1) 1249 if (i==fg_pipe->num_progs-1)
1250 rcode=WEXITSTATUS(status); 1250 rcode=WEXITSTATUS(status);
1251 (fg_pipe->num_progs)--; 1251 (fg_pipe->num_progs)--;
1252 return(rcode); 1252 return(rcode);
@@ -1289,7 +1289,7 @@ static int checkjobs(struct pipe* fg_pipe)
1289 if (pi->stopped_progs == pi->num_progs) { 1289 if (pi->stopped_progs == pi->num_progs) {
1290 printf("\n"JOB_STATUS_FORMAT, pi->jobid, "Stopped", pi->text); 1290 printf("\n"JOB_STATUS_FORMAT, pi->jobid, "Stopped", pi->text);
1291 } 1291 }
1292#endif 1292#endif
1293 } 1293 }
1294 } 1294 }
1295 1295
@@ -1378,7 +1378,7 @@ static int run_pipe_real(struct pipe *pi)
1378 /* Ok, this case is tricky. We have to decide if this is a 1378 /* Ok, this case is tricky. We have to decide if this is a
1379 * local variable, or an already exported variable. If it is 1379 * local variable, or an already exported variable. If it is
1380 * already exported, we have to export the new value. If it is 1380 * already exported, we have to export the new value. If it is
1381 * not exported, we need only set this as a local variable. 1381 * not exported, we need only set this as a local variable.
1382 * This junk is all to decide whether or not to export this 1382 * This junk is all to decide whether or not to export this
1383 * variable. */ 1383 * variable. */
1384 int export_me=0; 1384 int export_me=0;
@@ -1408,7 +1408,7 @@ static int run_pipe_real(struct pipe *pi)
1408 } 1408 }
1409 if (child->sp) { 1409 if (child->sp) {
1410 char * str = NULL; 1410 char * str = NULL;
1411 1411
1412 str = make_string((child->argv + i)); 1412 str = make_string((child->argv + i));
1413 parse_string_outer(str, FLAG_EXIT_FROM_LOOP | FLAG_REPARSING); 1413 parse_string_outer(str, FLAG_EXIT_FROM_LOOP | FLAG_REPARSING);
1414 free(str); 1414 free(str);
@@ -1454,7 +1454,7 @@ static int run_pipe_real(struct pipe *pi)
1454#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__) 1454#if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
1455 if (!(child->pid = fork())) 1455 if (!(child->pid = fork()))
1456#else 1456#else
1457 if (!(child->pid = vfork())) 1457 if (!(child->pid = vfork()))
1458#endif 1458#endif
1459 { 1459 {
1460 /* Set the handling for job control signals back to the default. */ 1460 /* Set the handling for job control signals back to the default. */
@@ -1465,7 +1465,7 @@ static int run_pipe_real(struct pipe *pi)
1465 signal(SIGTTIN, SIG_DFL); 1465 signal(SIGTTIN, SIG_DFL);
1466 signal(SIGTTOU, SIG_DFL); 1466 signal(SIGTTOU, SIG_DFL);
1467 signal(SIGCHLD, SIG_DFL); 1467 signal(SIGCHLD, SIG_DFL);
1468 1468
1469 close_all(); 1469 close_all();
1470 1470
1471 if (nextin != 0) { 1471 if (nextin != 0) {
@@ -1497,7 +1497,7 @@ static int run_pipe_real(struct pipe *pi)
1497 1497
1498 pseudo_exec(child); 1498 pseudo_exec(child);
1499 } 1499 }
1500 1500
1501 1501
1502 /* put our child in the process group whose leader is the 1502 /* put our child in the process group whose leader is the
1503 first process in this pipe */ 1503 first process in this pipe */
@@ -1513,7 +1513,7 @@ static int run_pipe_real(struct pipe *pi)
1513 if (nextout != 1) 1513 if (nextout != 1)
1514 close(nextout); 1514 close(nextout);
1515 1515
1516 /* If there isn't another process, nextin is garbage 1516 /* If there isn't another process, nextin is garbage
1517 but it doesn't matter */ 1517 but it doesn't matter */
1518 nextin = pipefds[0]; 1518 nextin = pipefds[0];
1519 } 1519 }
@@ -1539,12 +1539,12 @@ static int run_list_real(struct pipe *pi)
1539 (rpipe->next == NULL)) { 1539 (rpipe->next == NULL)) {
1540 syntax(); 1540 syntax();
1541 return 1; 1541 return 1;
1542 } 1542 }
1543 if ((rpipe->r_mode == RES_IN && 1543 if ((rpipe->r_mode == RES_IN &&
1544 (rpipe->next->r_mode == RES_IN && 1544 (rpipe->next->r_mode == RES_IN &&
1545 rpipe->next->progs->argv != NULL))|| 1545 rpipe->next->progs->argv != NULL))||
1546 (rpipe->r_mode == RES_FOR && 1546 (rpipe->r_mode == RES_FOR &&
1547 rpipe->next->r_mode != RES_IN)) { 1547 rpipe->next->r_mode != RES_IN)) {
1548 syntax(); 1548 syntax();
1549 return 1; 1549 return 1;
1550 } 1550 }
@@ -1572,7 +1572,7 @@ static int run_list_real(struct pipe *pi)
1572 if (rmode == RES_ELIF && !if_code) continue; 1572 if (rmode == RES_ELIF && !if_code) continue;
1573 if (rmode == RES_FOR && pi->num_progs) { 1573 if (rmode == RES_FOR && pi->num_progs) {
1574 if (!list) { 1574 if (!list) {
1575 /* if no variable values after "in" we skip "for" */ 1575 /* if no variable values after "in" we skip "for" */
1576 if (!pi->next->progs->argv) continue; 1576 if (!pi->next->progs->argv) continue;
1577 /* create list of variable values */ 1577 /* create list of variable values */
1578 list = make_list_in(pi->next->progs->argv, 1578 list = make_list_in(pi->next->progs->argv,
@@ -1581,7 +1581,7 @@ static int run_list_real(struct pipe *pi)
1581 save_name = pi->progs->argv[0]; 1581 save_name = pi->progs->argv[0];
1582 pi->progs->argv[0] = NULL; 1582 pi->progs->argv[0] = NULL;
1583 flag_rep = 1; 1583 flag_rep = 1;
1584 } 1584 }
1585 if (!(*list)) { 1585 if (!(*list)) {
1586 free(pi->progs->argv[0]); 1586 free(pi->progs->argv[0]);
1587 free(save_list); 1587 free(save_list);
@@ -1591,26 +1591,26 @@ static int run_list_real(struct pipe *pi)
1591 pi->progs->glob_result.gl_pathv[0] = 1591 pi->progs->glob_result.gl_pathv[0] =
1592 pi->progs->argv[0]; 1592 pi->progs->argv[0];
1593 continue; 1593 continue;
1594 } else { 1594 } else {
1595 /* insert new value from list for variable */ 1595 /* insert new value from list for variable */
1596 if (pi->progs->argv[0]) 1596 if (pi->progs->argv[0])
1597 free(pi->progs->argv[0]); 1597 free(pi->progs->argv[0]);
1598 pi->progs->argv[0] = *list++; 1598 pi->progs->argv[0] = *list++;
1599 pi->progs->glob_result.gl_pathv[0] = 1599 pi->progs->glob_result.gl_pathv[0] =
1600 pi->progs->argv[0]; 1600 pi->progs->argv[0];
1601 } 1601 }
1602 } 1602 }
1603 if (rmode == RES_IN) continue; 1603 if (rmode == RES_IN) continue;
1604 if (rmode == RES_DO) { 1604 if (rmode == RES_DO) {
1605 if (!flag_rep) continue; 1605 if (!flag_rep) continue;
1606 } 1606 }
1607 if ((rmode == RES_DONE)) { 1607 if ((rmode == RES_DONE)) {
1608 if (flag_rep) { 1608 if (flag_rep) {
1609 flag_restore = 1; 1609 flag_restore = 1;
1610 } else { 1610 } else {
1611 rpipe = NULL; 1611 rpipe = NULL;
1612 } 1612 }
1613 } 1613 }
1614 if (pi->num_progs == 0) continue; 1614 if (pi->num_progs == 0) continue;
1615 save_num_progs = pi->num_progs; /* save number of programs */ 1615 save_num_progs = pi->num_progs; /* save number of programs */
1616 rcode = run_pipe_real(pi); 1616 rcode = run_pipe_real(pi);
@@ -1642,9 +1642,9 @@ static int run_list_real(struct pipe *pi)
1642 pi->num_progs = save_num_progs; /* restore number of programs */ 1642 pi->num_progs = save_num_progs; /* restore number of programs */
1643 if ( rmode == RES_IF || rmode == RES_ELIF ) 1643 if ( rmode == RES_IF || rmode == RES_ELIF )
1644 next_if_code=rcode; /* can be overwritten a number of times */ 1644 next_if_code=rcode; /* can be overwritten a number of times */
1645 if (rmode == RES_WHILE) 1645 if (rmode == RES_WHILE)
1646 flag_rep = !last_return_code; 1646 flag_rep = !last_return_code;
1647 if (rmode == RES_UNTIL) 1647 if (rmode == RES_UNTIL)
1648 flag_rep = last_return_code; 1648 flag_rep = last_return_code;
1649 if ( (rcode==EXIT_SUCCESS && pi->followup==PIPE_OR) || 1649 if ( (rcode==EXIT_SUCCESS && pi->followup==PIPE_OR) ||
1650 (rcode!=EXIT_SUCCESS && pi->followup==PIPE_AND) ) 1650 (rcode!=EXIT_SUCCESS && pi->followup==PIPE_AND) )
@@ -1723,7 +1723,7 @@ static int free_pipe_list(struct pipe *head, int indent)
1723 pi->next=NULL; 1723 pi->next=NULL;
1724 free(pi); 1724 free(pi);
1725 } 1725 }
1726 return rcode; 1726 return rcode;
1727} 1727}
1728 1728
1729/* Select which version we will use */ 1729/* Select which version we will use */
@@ -1732,7 +1732,7 @@ static int run_list(struct pipe *pi)
1732 int rcode=0; 1732 int rcode=0;
1733 if (fake_mode==0) { 1733 if (fake_mode==0) {
1734 rcode = run_list_real(pi); 1734 rcode = run_list_real(pi);
1735 } 1735 }
1736 /* free_pipe_list has the side effect of clearing memory 1736 /* free_pipe_list has the side effect of clearing memory
1737 * In the long run that function can be merged with run_list_real, 1737 * In the long run that function can be merged with run_list_real,
1738 * but doing that now would hobble the debugging effort. */ 1738 * but doing that now would hobble the debugging effort. */
@@ -1862,7 +1862,7 @@ static int set_local_var(const char *s, int flg_export)
1862 1862
1863 /* Assume when we enter this function that we are already in 1863 /* Assume when we enter this function that we are already in
1864 * NAME=VALUE format. So the first order of business is to 1864 * NAME=VALUE format. So the first order of business is to
1865 * split 's' on the '=' into 'name' and 'value' */ 1865 * split 's' on the '=' into 'name' and 'value' */
1866 value = strchr(name, '='); 1866 value = strchr(name, '=');
1867 if (value==0 && ++value==0) { 1867 if (value==0 && ++value==0) {
1868 free(name); 1868 free(name);
@@ -1991,7 +1991,7 @@ static int setup_redirect(struct p_context *ctx, int fd, redir_type style,
1991 1991
1992 debug_printf("Redirect type %d%s\n", redir->fd, redir_table[style].descrip); 1992 debug_printf("Redirect type %d%s\n", redir->fd, redir_table[style].descrip);
1993 1993
1994 /* Check for a '2>&1' type redirect */ 1994 /* Check for a '2>&1' type redirect */
1995 redir->dup = redirect_dup_num(input); 1995 redir->dup = redirect_dup_num(input);
1996 if (redir->dup == -2) return 1; /* syntax error */ 1996 if (redir->dup == -2) return 1; /* syntax error */
1997 if (redir->dup != -1) { 1997 if (redir->dup != -1) {
@@ -2377,9 +2377,9 @@ static int parse_group(o_string *dest, struct p_context *ctx,
2377static char *lookup_param(char *src) 2377static char *lookup_param(char *src)
2378{ 2378{
2379 char *p=NULL; 2379 char *p=NULL;
2380 if (src) { 2380 if (src) {
2381 p = getenv(src); 2381 p = getenv(src);
2382 if (!p) 2382 if (!p)
2383 p = get_local_var(src); 2383 p = get_local_var(src);
2384 } 2384 }
2385 return p; 2385 return p;
@@ -2499,7 +2499,7 @@ int parse_stream(o_string *dest, struct p_context *ctx,
2499 if (m==2) { /* unquoted IFS */ 2499 if (m==2) { /* unquoted IFS */
2500 if (done_word(dest, ctx)) { 2500 if (done_word(dest, ctx)) {
2501 return 1; 2501 return 1;
2502 } 2502 }
2503 /* If we aren't performing a substitution, treat a newline as a 2503 /* If we aren't performing a substitution, treat a newline as a
2504 * command separator. */ 2504 * command separator. */
2505 if (end_trigger != '\0' && ch=='\n') 2505 if (end_trigger != '\0' && ch=='\n')
@@ -2624,7 +2624,7 @@ int parse_stream(o_string *dest, struct p_context *ctx,
2624 } 2624 }
2625 /* complain if quote? No, maybe we just finished a command substitution 2625 /* complain if quote? No, maybe we just finished a command substitution
2626 * that was quoted. Example: 2626 * that was quoted. Example:
2627 * $ echo "`cat foo` plus more" 2627 * $ echo "`cat foo` plus more"
2628 * and we just got the EOF generated by the subshell that ran "cat foo" 2628 * and we just got the EOF generated by the subshell that ran "cat foo"
2629 * The only real complaint is if we got an EOF when end_trigger != '\0', 2629 * The only real complaint is if we got an EOF when end_trigger != '\0',
2630 * that is, we were really supposed to get end_trigger, and never got 2630 * that is, we were really supposed to get end_trigger, and never got
@@ -2684,7 +2684,7 @@ int parse_stream_outer(struct in_str *inp, int flag)
2684 if (ctx.old_flag != 0) { 2684 if (ctx.old_flag != 0) {
2685 free(ctx.stack); 2685 free(ctx.stack);
2686 b_reset(&temp); 2686 b_reset(&temp);
2687 } 2687 }
2688 temp.nonnull = 0; 2688 temp.nonnull = 0;
2689 temp.quote = 0; 2689 temp.quote = 0;
2690 inp->p = NULL; 2690 inp->p = NULL;
@@ -2748,9 +2748,9 @@ int hush_main(int argc, char **argv)
2748 /* XXX what should these be while sourcing /etc/profile? */ 2748 /* XXX what should these be while sourcing /etc/profile? */
2749 global_argc = argc; 2749 global_argc = argc;
2750 global_argv = argv; 2750 global_argv = argv;
2751 2751
2752 /* (re?) initialize globals. Sometimes hush_main() ends up calling 2752 /* (re?) initialize globals. Sometimes hush_main() ends up calling
2753 * hush_main(), therefore we cannot rely on the BSS to zero out this 2753 * hush_main(), therefore we cannot rely on the BSS to zero out this
2754 * stuff. Reset these to 0 every time. */ 2754 * stuff. Reset these to 0 every time. */
2755 ifs = NULL; 2755 ifs = NULL;
2756 /* map[] is taken care of with call to update_ifs_map() */ 2756 /* map[] is taken care of with call to update_ifs_map() */
@@ -2770,7 +2770,7 @@ int hush_main(int argc, char **argv)
2770#endif 2770#endif
2771 PS2 = "> "; 2771 PS2 = "> ";
2772 2772
2773 /* initialize our shell local variables with the values 2773 /* initialize our shell local variables with the values
2774 * currently living in the environment */ 2774 * currently living in the environment */
2775 if (e) { 2775 if (e) {
2776 for (; *e; e++) 2776 for (; *e; e++)
@@ -2790,7 +2790,7 @@ int hush_main(int argc, char **argv)
2790 } 2790 }
2791 } 2791 }
2792 input=stdin; 2792 input=stdin;
2793 2793
2794 while ((opt = getopt(argc, argv, "c:xif")) > 0) { 2794 while ((opt = getopt(argc, argv, "c:xif")) > 0) {
2795 switch (opt) { 2795 switch (opt) {
2796 case 'c': 2796 case 'c':
@@ -2832,13 +2832,13 @@ int hush_main(int argc, char **argv)
2832 debug_printf("\ninteractive=%d\n", interactive); 2832 debug_printf("\ninteractive=%d\n", interactive);
2833 if (interactive) { 2833 if (interactive) {
2834 /* Looks like they want an interactive shell */ 2834 /* Looks like they want an interactive shell */
2835#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET 2835#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
2836 printf( "\n\n" BB_BANNER " hush - the humble shell v0.01 (testing)\n"); 2836 printf( "\n\n" BB_BANNER " hush - the humble shell v0.01 (testing)\n");
2837 printf( "Enter 'help' for a list of built-in commands.\n\n"); 2837 printf( "Enter 'help' for a list of built-in commands.\n\n");
2838#endif 2838#endif
2839 setup_job_control(); 2839 setup_job_control();
2840 } 2840 }
2841 2841
2842 if (argv[optind]==NULL) { 2842 if (argv[optind]==NULL) {
2843 opt=parse_file_outer(stdin); 2843 opt=parse_file_outer(stdin);
2844 goto final_return; 2844 goto final_return;
@@ -2877,7 +2877,7 @@ static char *insert_var_value(char *inp)
2877 int len; 2877 int len;
2878 int done = 0; 2878 int done = 0;
2879 char *p, *p1, *res_str = NULL; 2879 char *p, *p1, *res_str = NULL;
2880 2880
2881 while ((p = strchr(inp, SPECIAL_VAR_SYMBOL))) { 2881 while ((p = strchr(inp, SPECIAL_VAR_SYMBOL))) {
2882 if (p != inp) { 2882 if (p != inp) {
2883 len = p - inp; 2883 len = p - inp;
@@ -2893,7 +2893,7 @@ static char *insert_var_value(char *inp)
2893 res_str = xrealloc(res_str, (1 + len)); 2893 res_str = xrealloc(res_str, (1 + len));
2894 strcpy((res_str + res_str_len), p1); 2894 strcpy((res_str + res_str_len), p1);
2895 res_str_len = len; 2895 res_str_len = len;
2896 } 2896 }
2897 *p = SPECIAL_VAR_SYMBOL; 2897 *p = SPECIAL_VAR_SYMBOL;
2898 inp = ++p; 2898 inp = ++p;
2899 done = 1; 2899 done = 1;
@@ -2915,8 +2915,8 @@ static char **make_list_in(char **inp, char *name)
2915 int n = 0; 2915 int n = 0;
2916 char **list; 2916 char **list;
2917 char *p1, *p2, *p3; 2917 char *p1, *p2, *p3;
2918 2918
2919 /* create list of variable values */ 2919 /* create list of variable values */
2920 list = xmalloc(sizeof(*list)); 2920 list = xmalloc(sizeof(*list));
2921 for (i = 0; inp[i]; i++) { 2921 for (i = 0; inp[i]; i++) {
2922 p3 = insert_var_value(inp[i]); 2922 p3 = insert_var_value(inp[i]);
@@ -2928,13 +2928,13 @@ static char **make_list_in(char **inp, char *name)
2928 } 2928 }
2929 if ((p2 = strchr(p1, ' '))) { 2929 if ((p2 = strchr(p1, ' '))) {
2930 len = p2 - p1; 2930 len = p2 - p1;
2931 } else { 2931 } else {
2932 len = strlen(p1); 2932 len = strlen(p1);
2933 p2 = p1 + len; 2933 p2 = p1 + len;
2934 } 2934 }
2935 /* we use n + 2 in realloc for list,because we add 2935 /* we use n + 2 in realloc for list,because we add
2936 * new element and then we will add NULL element */ 2936 * new element and then we will add NULL element */
2937 list = xrealloc(list, sizeof(*list) * (n + 2)); 2937 list = xrealloc(list, sizeof(*list) * (n + 2));
2938 list[n] = xmalloc(2 + name_len + len); 2938 list[n] = xmalloc(2 + name_len + len);
2939 strcpy(list[n], name); 2939 strcpy(list[n], name);
2940 strcat(list[n], "="); 2940 strcat(list[n], "=");
@@ -2946,7 +2946,7 @@ static char **make_list_in(char **inp, char *name)
2946 } 2946 }
2947 list[n] = NULL; 2947 list[n] = NULL;
2948 return list; 2948 return list;
2949} 2949}
2950 2950
2951/* Make new string for parser */ 2951/* Make new string for parser */
2952static char * make_string(char ** inp) 2952static char * make_string(char ** inp)
diff --git a/shell/lash.c b/shell/lash.c
index e4b1b129f..d2d4298fb 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * lash -- the BusyBox Lame-Ass SHell 3 * lash -- the BusyBox Lame-Ass SHell
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Based in part on ladsh.c by Michael K. Johnson and Erik W. Troan, which is 7 * Based in part on ladsh.c by Michael K. Johnson and Erik W. Troan, which is
8 * under the following liberal license: "We have placed this source code in the 8 * under the following liberal license: "We have placed this source code in the
@@ -927,7 +927,7 @@ static int expand_arguments(char *command)
927 927
928 } 928 }
929 if (var) { 929 if (var) {
930 /* a single character construction was found, and 930 /* a single character construction was found, and
931 * already handled in the case statement */ 931 * already handled in the case statement */
932 src=dst+2; 932 src=dst+2;
933 } else { 933 } else {
@@ -1093,7 +1093,7 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
1093 1093
1094 prog->redirects[i].fd = -1; 1094 prog->redirects[i].fd = -1;
1095 if (buf != prog->argv[argc_l]) { 1095 if (buf != prog->argv[argc_l]) {
1096 /* the stuff before this character may be the file number 1096 /* the stuff before this character may be the file number
1097 being redirected */ 1097 being redirected */
1098 prog->redirects[i].fd = 1098 prog->redirects[i].fd =
1099 strtol(prog->argv[argc_l], &chptr, 10); 1099 strtol(prog->argv[argc_l], &chptr, 10);
diff --git a/shell/msh.c b/shell/msh.c
index 31dd04f3e..e7059507a 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -23,7 +23,7 @@
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software 24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * 26 *
27 * Original copyright notice is retained at the end of this file. 27 * Original copyright notice is retained at the end of this file.
28 */ 28 */
29 29
@@ -770,7 +770,7 @@ extern int msh_main(int argc, char **argv)
770 if (--argc > 0) 770 if (--argc > 0)
771 PUSHIO(aword, *++argv, iof = nlchar); 771 PUSHIO(aword, *++argv, iof = nlchar);
772 break; 772 break;
773 773
774 case 'q': 774 case 'q':
775 qflag = SIG_DFL; 775 qflag = SIG_DFL;
776 break; 776 break;
@@ -784,7 +784,7 @@ extern int msh_main(int argc, char **argv)
784 setval(prompt, ""); 784 setval(prompt, "");
785 iof = linechar; 785 iof = linechar;
786 break; 786 break;
787 787
788 case 'i': 788 case 'i':
789 interactive++; 789 interactive++;
790 default: 790 default:
@@ -809,7 +809,7 @@ extern int msh_main(int argc, char **argv)
809 PUSHIO(afile, 0, iof); 809 PUSHIO(afile, 0, iof);
810 if (isatty(0) && isatty(1) && !cflag) { 810 if (isatty(0) && isatty(1) && !cflag) {
811 interactive++; 811 interactive++;
812#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET 812#ifndef CONFIG_FEATURE_SH_EXTRA_QUIET
813 printf( "\n\n" BB_BANNER " Built-in shell (msh)\n"); 813 printf( "\n\n" BB_BANNER " Built-in shell (msh)\n");
814 printf( "Enter 'help' for a list of built-in commands.\n\n"); 814 printf( "Enter 'help' for a list of built-in commands.\n\n");
815#endif 815#endif
@@ -838,7 +838,7 @@ extern int msh_main(int argc, char **argv)
838 ap++; 838 ap++;
839 } 839 }
840 } 840 }
841 } 841 }
842 setval(lookup("#"), putn((--dolc < 0) ? (dolc = 0) : dolc)); 842 setval(lookup("#"), putn((--dolc < 0) ? (dolc = 0) : dolc));
843 843
844 for (;;) { 844 for (;;) {
@@ -2303,7 +2303,7 @@ int act;
2303#if __GNUC__ 2303#if __GNUC__
2304 /* Avoid longjmp clobbering */ 2304 /* Avoid longjmp clobbering */
2305 (void) &wp; 2305 (void) &wp;
2306#endif 2306#endif
2307 2307
2308 2308
2309 if (t == NULL) 2309 if (t == NULL)
@@ -2318,7 +2318,7 @@ int act;
2318 case TPAREN: 2318 case TPAREN:
2319 rv = execute(t->left, pin, pout, 0); 2319 rv = execute(t->left, pin, pout, 0);
2320 break; 2320 break;
2321 2321
2322 case TCOM: 2322 case TCOM:
2323 { 2323 {
2324 int child; 2324 int child;
@@ -2395,7 +2395,7 @@ int act;
2395 } else { 2395 } else {
2396 i = -1; 2396 i = -1;
2397 while (*wp++ != NULL) 2397 while (*wp++ != NULL)
2398 ; 2398 ;
2399 } 2399 }
2400 vp = lookup(t->str); 2400 vp = lookup(t->str);
2401 while (setjmp(bc.brkpt)) 2401 while (setjmp(bc.brkpt))
@@ -2497,7 +2497,7 @@ forkexec( register struct op *t, int *pin, int *pout, int act, char **wp, int *p
2497 (void) &cp; 2497 (void) &cp;
2498 (void) &resetsig; 2498 (void) &resetsig;
2499 (void) &owp; 2499 (void) &owp;
2500#endif 2500#endif
2501 2501
2502 owp = wp; 2502 owp = wp;
2503 resetsig = 0; 2503 resetsig = 0;
@@ -2532,7 +2532,7 @@ forkexec( register struct op *t, int *pin, int *pout, int act, char **wp, int *p
2532 hintr = intr; 2532 hintr = intr;
2533 hbrklist = brklist; 2533 hbrklist = brklist;
2534 hexecflg = execflg; 2534 hexecflg = execflg;
2535 2535
2536 i = vfork(); 2536 i = vfork();
2537 if (i != 0) { 2537 if (i != 0) {
2538 /* who wrote this crappy non vfork safe shit? */ 2538 /* who wrote this crappy non vfork safe shit? */
@@ -2563,7 +2563,7 @@ forkexec( register struct op *t, int *pin, int *pout, int act, char **wp, int *p
2563 (*pforked)++; 2563 (*pforked)++;
2564 brklist = 0; 2564 brklist = 0;
2565 execflg = 0; 2565 execflg = 0;
2566 } 2566 }
2567 if (owp != NULL) 2567 if (owp != NULL)
2568 while ((cp = *owp++) != NULL && assign(cp, COPYV)) 2568 while ((cp = *owp++) != NULL && assign(cp, COPYV))
2569 if (shcom == NULL) 2569 if (shcom == NULL)
@@ -2841,7 +2841,7 @@ char *c, **v, **envp;
2841#endif 2841#endif
2842 optind = 1; 2842 optind = 1;
2843 if (find_applet_by_name(name)) { 2843 if (find_applet_by_name(name)) {
2844 /* We have to exec here since we vforked. Running 2844 /* We have to exec here since we vforked. Running
2845 * run_applet_by_name() won't work and bad things 2845 * run_applet_by_name() won't work and bad things
2846 * will happen. */ 2846 * will happen. */
2847 execve("/proc/self/exe", v, envp); 2847 execve("/proc/self/exe", v, envp);
@@ -2964,8 +2964,8 @@ static int dohelp(struct op *t )
2964 for (i=0, applet = applets; i < NUM_APPLETS; applet++, i++) { 2964 for (i=0, applet = applets; i < NUM_APPLETS; applet++, i++) {
2965 if (!applet->name) 2965 if (!applet->name)
2966 continue; 2966 continue;
2967 2967
2968 col += printf("%s%s", ((col == 0) ? "\t" : " "), 2968 col += printf("%s%s", ((col == 0) ? "\t" : " "),
2969 applet->name); 2969 applet->name);
2970 if (col > 60) { 2970 if (col > 60) {
2971 printf("\n"); 2971 printf("\n");
@@ -3194,7 +3194,7 @@ register struct op *t;
3194 if (n == SIGINT) 3194 if (n == SIGINT)
3195 setsig(n, onintr); 3195 setsig(n, onintr);
3196 else 3196 else
3197 setsig(n, n == SIGQUIT ? SIG_IGN 3197 setsig(n, n == SIGQUIT ? SIG_IGN
3198 : SIG_DFL); 3198 : SIG_DFL);
3199 else 3199 else
3200 setsig(n, SIG_DFL); 3200 setsig(n, SIG_DFL);
@@ -3784,7 +3784,7 @@ int quoted;
3784 /* Avoid longjmp clobbering */ 3784 /* Avoid longjmp clobbering */
3785 (void) &cp; 3785 (void) &cp;
3786#endif 3786#endif
3787 3787
3788 for (cp = e.iop->argp->aword; *cp != '`'; cp++) 3788 for (cp = e.iop->argp->aword; *cp != '`'; cp++)
3789 if (*cp == 0) { 3789 if (*cp == 0) {
3790 err("no closing `"); 3790 err("no closing `");
@@ -3837,7 +3837,7 @@ int quoted;
3837 err("unclosed ${\n"); 3837 err("unclosed ${\n");
3838 return(0); 3838 return(0);
3839 } 3839 }
3840 if (operator) { 3840 if (operator) {
3841 src++; 3841 src++;
3842 while (*src && (*src != '}')) { 3842 while (*src && (*src != '}')) {
3843 alt_value[alt_index++] = *src++; 3843 alt_value[alt_index++] = *src++;
@@ -3875,7 +3875,7 @@ int quoted;
3875 } 3875 }
3876 } 3876 }
3877 *dest = '\0'; 3877 *dest = '\0';
3878 3878
3879 if (openpipe(pf) < 0) 3879 if (openpipe(pf) < 0)
3880 return(0); 3880 return(0);
3881 while ((i = vfork()) == -1 && errno == EAGAIN) 3881 while ((i = vfork()) == -1 && errno == EAGAIN)
@@ -3897,7 +3897,7 @@ int quoted;
3897 for (j=0; j<=_NSIG; j++) 3897 for (j=0; j<=_NSIG; j++)
3898 if (ourtrap[j] && signal(j, SIG_IGN) != SIG_IGN) 3898 if (ourtrap[j] && signal(j, SIG_IGN) != SIG_IGN)
3899 signal(j, SIG_DFL); 3899 signal(j, SIG_DFL);
3900 3900
3901 dup2(pf[1], 1); 3901 dup2(pf[1], 1);
3902 closepipe(pf); 3902 closepipe(pf);
3903 3903
@@ -4121,7 +4121,7 @@ register struct wdblock *wb;
4121 wb->w_words[wb->w_nword++] = wd; 4121 wb->w_words[wb->w_nword++] = wd;
4122 return(wb); 4122 return(wb);
4123} 4123}
4124static 4124static
4125char ** 4125char **
4126getwords(wb) 4126getwords(wb)
4127register struct wdblock *wb; 4127register struct wdblock *wb;
@@ -4557,7 +4557,7 @@ register struct ioarg *ap;
4557 c = mycommand[position]; 4557 c = mycommand[position];
4558 position++; 4558 position++;
4559 return(c); 4559 return(c);
4560 } else 4560 } else
4561#endif 4561#endif
4562 { 4562 {
4563 i = safe_read(ap->afile, &c, sizeof(c)); 4563 i = safe_read(ap->afile, &c, sizeof(c));
@@ -4858,7 +4858,7 @@ int xdoll;
4858 char c; 4858 char c;
4859 char tname[30] = ".msh_XXXXXX"; 4859 char tname[30] = ".msh_XXXXXX";
4860 jmp_buf ev; 4860 jmp_buf ev;
4861 4861
4862 tf = mkstemp(tname); 4862 tf = mkstemp(tname);
4863 if (tf < 0) 4863 if (tf < 0)
4864 return (-1); 4864 return (-1);
@@ -4917,24 +4917,24 @@ int area;
4917/* 4917/*
4918 * Copyright (c) 1987,1997, Prentice Hall 4918 * Copyright (c) 1987,1997, Prentice Hall
4919 * All rights reserved. 4919 * All rights reserved.
4920 * 4920 *
4921 * Redistribution and use of the MINIX operating system in source and 4921 * Redistribution and use of the MINIX operating system in source and
4922 * binary forms, with or without modification, are permitted provided 4922 * binary forms, with or without modification, are permitted provided
4923 * that the following conditions are met: 4923 * that the following conditions are met:
4924 * 4924 *
4925 * Redistributions of source code must retain the above copyright 4925 * Redistributions of source code must retain the above copyright
4926 * notice, this list of conditions and the following disclaimer. 4926 * notice, this list of conditions and the following disclaimer.
4927 * 4927 *
4928 * Redistributions in binary form must reproduce the above 4928 * Redistributions in binary form must reproduce the above
4929 * copyright notice, this list of conditions and the following 4929 * copyright notice, this list of conditions and the following
4930 * disclaimer in the documentation and/or other materials provided 4930 * disclaimer in the documentation and/or other materials provided
4931 * with the distribution. 4931 * with the distribution.
4932 * 4932 *
4933 * Neither the name of Prentice Hall nor the names of the software 4933 * Neither the name of Prentice Hall nor the names of the software
4934 * authors or contributors may be used to endorse or promote 4934 * authors or contributors may be used to endorse or promote
4935 * products derived from this software without specific prior 4935 * products derived from this software without specific prior
4936 * written permission. 4936 * written permission.
4937 * 4937 *
4938 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND 4938 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
4939 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 4939 * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
4940 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 4940 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
diff --git a/sysdeps/linux/Config.in b/sysdeps/linux/Config.in
index 2559965f2..d288cc58c 100644
--- a/sysdeps/linux/Config.in
+++ b/sysdeps/linux/Config.in
@@ -101,7 +101,7 @@ config CONFIG_FEATURE_SUID_CONFIG
101 checking /etc/busybox.conf. The format of this file is as follows: 101 checking /etc/busybox.conf. The format of this file is as follows:
102 102
103 <applet> = [Ssx-][Ssx-][x-] (<username>|<uid>).(<groupname>|<gid>) 103 <applet> = [Ssx-][Ssx-][x-] (<username>|<uid>).(<groupname>|<gid>)
104 104
105 An example might help: 105 An example might help:
106 106
107 [SUID] 107 [SUID]
@@ -147,8 +147,8 @@ config CONFIG_STATIC
147 bool "Build BusyBox as a static binary (no shared libs)" 147 bool "Build BusyBox as a static binary (no shared libs)"
148 default n 148 default n
149 help 149 help
150 If you want to build a static BusyBox binary, which does not 150 If you want to build a static BusyBox binary, which does not
151 use or require any shared libraries, then enable this option. 151 use or require any shared libraries, then enable this option.
152 This can cause BusyBox to be considerably larger, so you should 152 This can cause BusyBox to be considerably larger, so you should
153 leave this option false unless you have a good reason (i.e. 153 leave this option false unless you have a good reason (i.e.
154 your target platform does not support shared libraries, or 154 your target platform does not support shared libraries, or
@@ -158,7 +158,7 @@ config CONFIG_STATIC
158 Most people will leave this set to 'N'. 158 Most people will leave this set to 'N'.
159 159
160config CONFIG_LFS 160config CONFIG_LFS
161 bool "Build with Large File Support (for accessing files > 2 GB)" 161 bool "Build with Large File Support (for accessing files > 2 GB)"
162 default n 162 default n
163 help 163 help
164 If you want to build BusyBox with large file support, then enable 164 If you want to build BusyBox with large file support, then enable
@@ -180,7 +180,7 @@ config CROSS_COMPILER_PREFIX
180 default "/usr/i386-linux-uclibc/bin/i386-uclibc-" 180 default "/usr/i386-linux-uclibc/bin/i386-uclibc-"
181 depends on USING_CROSS_COMPILER 181 depends on USING_CROSS_COMPILER
182 help 182 help
183 If you want to build BusyBox with a cross compiler, then you 183 If you want to build BusyBox with a cross compiler, then you
184 will need to set this to the cross-compiler prefix. For example, 184 will need to set this to the cross-compiler prefix. For example,
185 if my cross-compiler is /usr/i386-linux-uclibc/bin/i386-uclibc-gcc 185 if my cross-compiler is /usr/i386-linux-uclibc/bin/i386-uclibc-gcc
186 then I would enter '/usr/i386-linux-uclibc/bin/i386-uclibc-' here, 186 then I would enter '/usr/i386-linux-uclibc/bin/i386-uclibc-' here,
@@ -240,7 +240,7 @@ config CONFIG_DEBUG
240 help 240 help
241 Say Y here if you wish to compile BusyBox with debugging symbols. 241 Say Y here if you wish to compile BusyBox with debugging symbols.
242 This will allow you to use a debugger to examine BusyBox internals 242 This will allow you to use a debugger to examine BusyBox internals
243 while applets are running. This increases the size of the binary 243 while applets are running. This increases the size of the binary
244 considerably and should only be used when doing development. 244 considerably and should only be used when doing development.
245 If you are doing development and want to debug BusyBox, answer Y. 245 If you are doing development and want to debug BusyBox, answer Y.
246 246
@@ -261,7 +261,7 @@ config CONFIG_DMALLOC
261 -p check-fence -p check-heap -p check-lists -p check-blank \ 261 -p check-fence -p check-heap -p check-lists -p check-blank \
262 -p check-funcs -p realloc-copy -p allow-free-null 262 -p check-funcs -p realloc-copy -p allow-free-null
263 263
264 This will make BusyBox be considerable larger and run slower, so 264 This will make BusyBox be considerable larger and run slower, so
265 you should leave this option disabled for production use. 265 you should leave this option disabled for production use.
266 266
267config CONFIG_EFENCE 267config CONFIG_EFENCE
@@ -271,9 +271,9 @@ config CONFIG_EFENCE
271 help 271 help
272 This enables compiling with Electric-fence support. Electric 272 This enables compiling with Electric-fence support. Electric
273 fence is another very useful malloc debugging library which uses 273 fence is another very useful malloc debugging library which uses
274 your computer's virtual memory hardware to detect illegal memory 274 your computer's virtual memory hardware to detect illegal memory
275 accesses. This support will make BusyBox be considerable larger 275 accesses. This support will make BusyBox be considerable larger
276 and run slower, so you should leave this option disabled unless 276 and run slower, so you should leave this option disabled unless
277 you are hunting a hard to find memory problem. 277 you are hunting a hard to find memory problem.
278 278
279endmenu 279endmenu
diff --git a/sysklogd/Config.in b/sysklogd/Config.in
index a671f59f1..f77d79e8c 100644
--- a/sysklogd/Config.in
+++ b/sysklogd/Config.in
@@ -79,10 +79,10 @@ config CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING
79 default n 79 default n
80 depends on CONFIG_LOGREAD 80 depends on CONFIG_LOGREAD
81 help 81 help
82 'logread' ouput to slow serial terminals can have 82 'logread' ouput to slow serial terminals can have
83 side effects on syslog because of the semaphore. 83 side effects on syslog because of the semaphore.
84 This option make logread to double buffer copy 84 This option make logread to double buffer copy
85 from circular buffer, minimizing semaphore 85 from circular buffer, minimizing semaphore
86 contention at some minor memory expense. 86 contention at some minor memory expense.
87 87
88config CONFIG_KLOGD 88config CONFIG_KLOGD
diff --git a/sysklogd/Makefile b/sysklogd/Makefile
index 0c01f546f..f6ce14530 100644
--- a/sysklogd/Makefile
+++ b/sysklogd/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/sysklogd/Makefile.in b/sysklogd/Makefile.in
index d088ae855..1c6e90774 100644
--- a/sysklogd/Makefile.in
+++ b/sysklogd/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index df3a668dd..94da61658 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -6,7 +6,7 @@
6 * Changes: Made this a standalone busybox module which uses standalone 6 * Changes: Made this a standalone busybox module which uses standalone
7 * syslog() client interface. 7 * syslog() client interface.
8 * 8 *
9 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 9 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
10 * 10 *
11 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> 11 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org>
12 * 12 *
@@ -136,7 +136,7 @@ extern int klogd_main(int argc, char **argv)
136 bb_show_usage(); 136 bb_show_usage();
137 } 137 }
138 console_log_level++; 138 console_log_level++;
139 139
140 break; 140 break;
141 case 'n': 141 case 'n':
142 doFork = FALSE; 142 doFork = FALSE;
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 252cfc494..981cef322 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini logger implementation for busybox 3 * Mini logger implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -49,11 +49,11 @@
49# endif 49# endif
50#endif 50#endif
51 51
52/* Decode a symbolic name to a numeric value 52/* Decode a symbolic name to a numeric value
53 * this function is based on code 53 * this function is based on code
54 * Copyright (c) 1983, 1993 54 * Copyright (c) 1983, 1993
55 * The Regents of the University of California. All rights reserved. 55 * The Regents of the University of California. All rights reserved.
56 * 56 *
57 * Original copyright notice is retained at the end of this file. 57 * Original copyright notice is retained at the end of this file.
58 */ 58 */
59static int decode(char *name, CODE * codetab) 59static int decode(char *name, CODE * codetab)
@@ -71,7 +71,7 @@ static int decode(char *name, CODE * codetab)
71 return (-1); 71 return (-1);
72} 72}
73 73
74/* Decode a symbolic name to a numeric value 74/* Decode a symbolic name to a numeric value
75 * this function is based on code 75 * this function is based on code
76 * Copyright (c) 1983, 1993 76 * Copyright (c) 1983, 1993
77 * The Regents of the University of California. All rights reserved. 77 * The Regents of the University of California. All rights reserved.
@@ -132,7 +132,7 @@ extern int logger_main(int argc, char **argv)
132 do { 132 do {
133 /* read from stdin */ 133 /* read from stdin */
134 i = 0; 134 i = 0;
135 while ((c = getc(stdin)) != EOF && c != '\n' && 135 while ((c = getc(stdin)) != EOF && c != '\n' &&
136 i < (sizeof(buf)-1)) { 136 i < (sizeof(buf)-1)) {
137 buf[i++] = c; 137 buf[i++] = c;
138 } 138 }
@@ -180,8 +180,8 @@ extern int logger_main(int argc, char **argv)
180 * notice, this list of conditions and the following disclaimer in the 180 * notice, this list of conditions and the following disclaimer in the
181 * documentation and/or other materials provided with the distribution. 181 * documentation and/or other materials provided with the distribution.
182 * 182 *
183 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change 183 * 3. <BSD Advertising Clause omitted per the July 22, 1999 licensing change
184 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change> 184 * ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change>
185 * 185 *
186 * 4. Neither the name of the University nor the names of its contributors 186 * 4. Neither the name of the University nor the names of its contributors
187 * may be used to endorse or promote products derived from this software 187 * may be used to endorse or promote products derived from this software
diff --git a/sysklogd/logread.c b/sysklogd/logread.c
index 207e78b57..70d1db631 100644
--- a/sysklogd/logread.c
+++ b/sysklogd/logread.c
@@ -62,13 +62,13 @@ static void interrupted(int sig);
62 */ 62 */
63static inline void sem_up(int semid) 63static inline void sem_up(int semid)
64{ 64{
65 if ( semop(semid, SMrup, 1) == -1 ) 65 if ( semop(semid, SMrup, 1) == -1 )
66 error_exit("semop[SMrup]"); 66 error_exit("semop[SMrup]");
67} 67}
68 68
69/* 69/*
70 * sem_down - down()'s a semaphore 70 * sem_down - down()'s a semaphore
71 */ 71 */
72static inline void sem_down(int semid) 72static inline void sem_down(int semid)
73{ 73{
74 if ( semop(semid, SMrdn, 2) == -1 ) 74 if ( semop(semid, SMrdn, 2) == -1 )
@@ -79,7 +79,7 @@ extern int logread_main(int argc, char **argv)
79{ 79{
80 int i; 80 int i;
81 int follow=0; 81 int follow=0;
82 82
83 if (argc == 2 && strcmp(argv[1],"-f")==0) { 83 if (argc == 2 && strcmp(argv[1],"-f")==0) {
84 follow = 1; 84 follow = 1;
85 } else { 85 } else {
@@ -87,16 +87,16 @@ extern int logread_main(int argc, char **argv)
87 if (argc > 1) 87 if (argc > 1)
88 bb_show_usage(); 88 bb_show_usage();
89 } 89 }
90 90
91 // handle intrrupt signal 91 // handle intrrupt signal
92 if (setjmp(jmp_env)) goto output_end; 92 if (setjmp(jmp_env)) goto output_end;
93 93
94 // attempt to redefine ^C signal 94 // attempt to redefine ^C signal
95 signal(SIGINT, interrupted); 95 signal(SIGINT, interrupted);
96 96
97 if ( (log_shmid = shmget(KEY_ID, 0, 0)) == -1) 97 if ( (log_shmid = shmget(KEY_ID, 0, 0)) == -1)
98 error_exit("Can't find circular buffer"); 98 error_exit("Can't find circular buffer");
99 99
100 // Attach shared memory to our char* 100 // Attach shared memory to our char*
101 if ( (buf = shmat(log_shmid, NULL, SHM_RDONLY)) == NULL) 101 if ( (buf = shmat(log_shmid, NULL, SHM_RDONLY)) == NULL)
102 error_exit("Can't get access to circular buffer from syslogd"); 102 error_exit("Can't get access to circular buffer from syslogd");
@@ -113,7 +113,7 @@ extern int logread_main(int argc, char **argv)
113 int log_len,j; 113 int log_len,j;
114#endif 114#endif
115 115
116 sem_down(log_semid); 116 sem_down(log_semid);
117 117
118 //printf("head: %i tail: %i size: %i\n",buf->head,buf->tail,buf->size); 118 //printf("head: %i tail: %i size: %i\n",buf->head,buf->tail,buf->size);
119 if (buf->head == buf->tail || i==buf->tail) { 119 if (buf->head == buf->tail || i==buf->tail) {
@@ -125,8 +125,8 @@ extern int logread_main(int argc, char **argv)
125 printf("<empty syslog>\n"); 125 printf("<empty syslog>\n");
126 } 126 }
127 } 127 }
128 128
129 // Read Memory 129 // Read Memory
130#ifdef CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING 130#ifdef CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING
131 log_len = buf->tail - i; 131 log_len = buf->tail - i;
132 if (log_len < 0) 132 if (log_len < 0)
@@ -165,10 +165,10 @@ extern int logread_main(int argc, char **argv)
165 } while (follow); 165 } while (follow);
166 166
167output_end: 167output_end:
168 if (log_shmid != -1) 168 if (log_shmid != -1)
169 shmdt(buf); 169 shmdt(buf);
170 170
171 return EXIT_SUCCESS; 171 return EXIT_SUCCESS;
172} 172}
173 173
174static void interrupted(int sig){ 174static void interrupted(int sig){
@@ -179,7 +179,7 @@ static void interrupted(int sig){
179static void error_exit(const char *str){ 179static void error_exit(const char *str){
180 perror(str); 180 perror(str);
181 //release all acquired resources 181 //release all acquired resources
182 if (log_shmid != -1) 182 if (log_shmid != -1)
183 shmdt(buf); 183 shmdt(buf);
184 184
185 exit(1); 185 exit(1);
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index a533bce6b..ac326aa00 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini syslogd implementation for busybox 3 * Mini syslogd implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org> 7 * Copyright (C) 2000 by Karl M. Hegbloom <karlheg@debian.org>
8 * 8 *
diff --git a/tests/multibuild.pl b/tests/multibuild.pl
index a3e49a625..301ed3500 100755
--- a/tests/multibuild.pl
+++ b/tests/multibuild.pl
@@ -6,7 +6,7 @@
6# flush out are those involving preprocessor instructions in 6# flush out are those involving preprocessor instructions in
7# utility.c. 7# utility.c.
8# 8#
9# TODO: some time it might be nice to list absolute and 9# TODO: some time it might be nice to list absolute and
10# differential object sizes for each option... 10# differential object sizes for each option...
11# 11#
12 12
diff --git a/tests/tester.sh b/tests/tester.sh
index 09ba750ec..a17762f05 100755
--- a/tests/tester.sh
+++ b/tests/tester.sh
@@ -87,7 +87,7 @@ unalias -a # gets rid of aliases that might create different output
87 87
88 88
89# do extra setup (if any) 89# do extra setup (if any)
90if [ ! -z "$SETUP" ] 90if [ ! -z "$SETUP" ]
91then 91then
92 [ $DEBUG -ge 2 ] && echo "running setup commands in $SETUP" 92 [ $DEBUG -ge 2 ] && echo "running setup commands in $SETUP"
93 source $SETUP 93 source $SETUP
@@ -136,7 +136,7 @@ do
136 if [ $? -eq 1 ] 136 if [ $? -eq 1 ]
137 then 137 then
138 [ $DEBUG -ge 1 ] && echo "FAILED: $line" | tee -a $LOGFILE 138 [ $DEBUG -ge 1 ] && echo "FAILED: $line" | tee -a $LOGFILE
139 diff -u $CONFIG_OUT $GNU_OUT >> $LOGFILE 139 diff -u $CONFIG_OUT $GNU_OUT >> $LOGFILE
140 fi 140 fi
141 fi 141 fi
142 fi 142 fi
@@ -151,7 +151,7 @@ done
151 151
152 152
153# do extra cleanup (if any) 153# do extra cleanup (if any)
154if [ ! -z "$CLEANUP" ] 154if [ ! -z "$CLEANUP" ]
155then 155then
156 [ $DEBUG -ge 2 ] && echo "running cleanup commands in $CLEANUP" 156 [ $DEBUG -ge 2 ] && echo "running cleanup commands in $CLEANUP"
157 source $CLEANUP 157 source $CLEANUP
diff --git a/util-linux/Config.in b/util-linux/Config.in
index 2bb9c09cc..c97e5c436 100644
--- a/util-linux/Config.in
+++ b/util-linux/Config.in
@@ -71,7 +71,7 @@ config CONFIG_FDISK
71 help 71 help
72 The fdisk utility is used to divide hard disks into one or more 72 The fdisk utility is used to divide hard disks into one or more
73 logical disks, which are generally called partitions. This utility 73 logical disks, which are generally called partitions. This utility
74 can be used to list and edit the set of partitions or BSD style 74 can be used to list and edit the set of partitions or BSD style
75 'disk slices' that are defined on a hard drive. 75 'disk slices' that are defined on a hard drive.
76 76
77if !CONFIG_LFS 77if !CONFIG_LFS
@@ -84,7 +84,7 @@ config FDISK_SUPPORT_LARGE_DISKS
84endif 84endif
85 85
86config CONFIG_FEATURE_FDISK_WRITABLE 86config CONFIG_FEATURE_FDISK_WRITABLE
87 bool " Write support" 87 bool " Write support"
88 default y 88 default y
89 depends on CONFIG_FDISK 89 depends on CONFIG_FDISK
90 help 90 help
@@ -95,7 +95,7 @@ config CONFIG_FEATURE_FDISK_WRITABLE
95config CONFIG_FEATURE_AIX_LABEL 95config CONFIG_FEATURE_AIX_LABEL
96 bool " Support AIX disklabels" 96 bool " Support AIX disklabels"
97 default n 97 default n
98 depends on CONFIG_FDISK && CONFIG_FEATURE_FDISK_WRITABLE 98 depends on CONFIG_FDISK && CONFIG_FEATURE_FDISK_WRITABLE
99 help 99 help
100 Enabling this option allows you to create or change AIX disklabels. 100 Enabling this option allows you to create or change AIX disklabels.
101 Most people can safely leave this option disabled. 101 Most people can safely leave this option disabled.
@@ -111,7 +111,7 @@ config CONFIG_FEATURE_SGI_LABEL
111config CONFIG_FEATURE_SUN_LABEL 111config CONFIG_FEATURE_SUN_LABEL
112 bool " Support SUN disklabels" 112 bool " Support SUN disklabels"
113 default n 113 default n
114 depends on CONFIG_FDISK && CONFIG_FEATURE_FDISK_WRITABLE 114 depends on CONFIG_FDISK && CONFIG_FEATURE_FDISK_WRITABLE
115 help 115 help
116 Enabling this option allows you to create or change SUN disklabels. 116 Enabling this option allows you to create or change SUN disklabels.
117 Most people can safely leave this option disabled. 117 Most people can safely leave this option disabled.
@@ -267,7 +267,7 @@ config CONFIG_RDATE
267 bool "rdate" 267 bool "rdate"
268 default n 268 default n
269 help 269 help
270 The rdate utility allows you to synchronize the date and time of your 270 The rdate utility allows you to synchronize the date and time of your
271 system clock with the date and time of a remote networked system using 271 system clock with the date and time of a remote networked system using
272 the RFC868 protocol, which is built into the inetd daemon on most 272 the RFC868 protocol, which is built into the inetd daemon on most
273 systems. 273 systems.
diff --git a/util-linux/Makefile b/util-linux/Makefile
index d2e496231..f2e2021f0 100644
--- a/util-linux/Makefile
+++ b/util-linux/Makefile
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/util-linux/Makefile.in b/util-linux/Makefile.in
index 8cd5f1bd0..f56d57464 100644
--- a/util-linux/Makefile.in
+++ b/util-linux/Makefile.in
@@ -1,6 +1,6 @@
1# Makefile for busybox 1# Makefile for busybox
2# 2#
3# Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 3# Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by 6# it under the terms of the GNU General Public License as published by
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index b7d17840f..2ca882714 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -10,8 +10,8 @@
10 * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org> 10 * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
11 * - added Native Language Support 11 * - added Native Language Support
12 * 12 *
13 * from util-linux -- adapted for busybox by 13 * from util-linux -- adapted for busybox by
14 * Erik Andersen <andersen@codepoet.org>. I ripped out Native Language 14 * Erik Andersen <andersen@codepoet.org>. I ripped out Native Language
15 * Support, replaced getopt, added some gotos for redundant stuff. 15 * Support, replaced getopt, added some gotos for redundant stuff.
16 * 16 *
17 * Audited and cleaned up on 7 March 2003 to reduce size of 17 * Audited and cleaned up on 7 March 2003 to reduce size of
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index b5f57b1e4..83bf309a3 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -20,7 +20,7 @@
20 * 20 *
21 * This is a from-scratch implementation of fbset; but the de facto fbset 21 * This is a from-scratch implementation of fbset; but the de facto fbset
22 * implementation was a good reference. fbset (original) is released under 22 * implementation was a good reference. fbset (original) is released under
23 * the GPL, and is (c) 1995-1999 by: 23 * the GPL, and is (c) 1995-1999 by:
24 * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be) 24 * Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
25 */ 25 */
26 26
@@ -89,8 +89,8 @@ static const int FBIOPUT_VSCREENINFO = 0x4601;
89struct fb_bitfield { 89struct fb_bitfield {
90 uint32_t offset; /* beginning of bitfield */ 90 uint32_t offset; /* beginning of bitfield */
91 uint32_t length; /* length of bitfield */ 91 uint32_t length; /* length of bitfield */
92 uint32_t msb_right; /* != 0 : Most significant bit is */ 92 uint32_t msb_right; /* != 0 : Most significant bit is */
93 /* right */ 93 /* right */
94}; 94};
95struct fb_var_screeninfo { 95struct fb_var_screeninfo {
96 uint32_t xres; /* visible resolution */ 96 uint32_t xres; /* visible resolution */
@@ -106,7 +106,7 @@ struct fb_var_screeninfo {
106 struct fb_bitfield red; /* bitfield in fb mem if true color, */ 106 struct fb_bitfield red; /* bitfield in fb mem if true color, */
107 struct fb_bitfield green; /* else only length is significant */ 107 struct fb_bitfield green; /* else only length is significant */
108 struct fb_bitfield blue; 108 struct fb_bitfield blue;
109 struct fb_bitfield transp; /* transparency */ 109 struct fb_bitfield transp; /* transparency */
110 110
111 uint32_t nonstd; /* != 0 Non standard pixel format */ 111 uint32_t nonstd; /* != 0 Non standard pixel format */
112 112
@@ -210,13 +210,13 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
210 if ((p = strstr(buf, "geometry "))) { 210 if ((p = strstr(buf, "geometry "))) {
211 p += 9; 211 p += 9;
212 212
213 sscanf(p, "%d %d %d %d %d", 213 sscanf(p, "%d %d %d %d %d",
214 &(base->xres), &(base->yres), 214 &(base->xres), &(base->yres),
215 &(base->xres_virtual), &(base->yres_virtual), 215 &(base->xres_virtual), &(base->yres_virtual),
216 &(base->bits_per_pixel)); 216 &(base->bits_per_pixel));
217 } else if ((p = strstr(buf, "timings "))) { 217 } else if ((p = strstr(buf, "timings "))) {
218 p += 8; 218 p += 8;
219 219
220 sscanf(p, "%d %d %d %d %d %d %d", 220 sscanf(p, "%d %d %d %d %d %d %d",
221 &(base->pixclock), 221 &(base->pixclock),
222 &(base->left_margin), &(base->right_margin), 222 &(base->left_margin), &(base->right_margin),
@@ -271,7 +271,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
271 base->sync |= FB_SYNC_EXT; 271 base->sync |= FB_SYNC_EXT;
272 } 272 }
273 } 273 }
274 274
275 if (strstr(buf, "endmode")) 275 if (strstr(buf, "endmode"))
276 return 1; 276 return 1;
277 } 277 }
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index 2374960df..f35aeb9f3 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -52,7 +52,7 @@
52#define BLKSSZGET _IO(0x12,104) /* get block device sector size */ 52#define BLKSSZGET _IO(0x12,104) /* get block device sector size */
53 53
54/* Avoid conflicts with the 2.6 kernel headers, which define 54/* Avoid conflicts with the 2.6 kernel headers, which define
55 * _IOR rather differently */ 55 * _IOR rather differently */
56#undef _IOR 56#undef _IOR
57#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) 57#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
58#define BLKGETSIZE64 _IOR(0x12,114,uint64_t) 58#define BLKGETSIZE64 _IOR(0x12,114,uint64_t)
@@ -4279,7 +4279,7 @@ read_int(uint low, uint dflt, uint high, uint base, char *mesg)
4279 4279
4280 while (isdigit(*++line_ptr)) 4280 while (isdigit(*++line_ptr))
4281 use_default = 0; 4281 use_default = 0;
4282 4282
4283 switch (*line_ptr) { 4283 switch (*line_ptr) {
4284 case 'c': 4284 case 'c':
4285 case 'C': 4285 case 'C':
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 38267e61e..e5061dc34 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -45,7 +45,7 @@ freeramdisk_main(int argc, char **argv)
45 } 45 }
46 46
47 fd = bb_xopen(argv[1], O_RDWR); 47 fd = bb_xopen(argv[1], O_RDWR);
48 48
49 result = ioctl(fd, BLKFLSBUF); 49 result = ioctl(fd, BLKFLSBUF);
50#ifdef CONFIG_FEATURE_CLEAN_UP 50#ifdef CONFIG_FEATURE_CLEAN_UP
51 close(fd); 51 close(fd);
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 4d07e028f..709a2a143 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -49,7 +49,7 @@
49 * 01.07.96 - Fixed the v2 fs stuff to use the right #defines and such 49 * 01.07.96 - Fixed the v2 fs stuff to use the right #defines and such
50 * for modern libcs (janl@math.uio.no, Nicolai Langfeldt) 50 * for modern libcs (janl@math.uio.no, Nicolai Langfeldt)
51 * 51 *
52 * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk 52 * 02.07.96 - Added C bit fiddling routines from rmk@ecs.soton.ac.uk
53 * (Russell King). He made them for ARM. It would seem 53 * (Russell King). He made them for ARM. It would seem
54 * that the ARM is powerful enough to do this in C whereas 54 * that the ARM is powerful enough to do this in C whereas
55 * i386 and m64k must use assembly to get it fast >:-) 55 * i386 and m64k must use assembly to get it fast >:-)
@@ -57,7 +57,7 @@
57 * (janl@math.uio.no, Nicolai Langfeldt) 57 * (janl@math.uio.no, Nicolai Langfeldt)
58 * 58 *
59 * 04.11.96 - Added minor fixes from Andreas Schwab to avoid compiler 59 * 04.11.96 - Added minor fixes from Andreas Schwab to avoid compiler
60 * warnings. Added mc68k bitops from 60 * warnings. Added mc68k bitops from
61 * Joerg Dorchain <dorchain@mpi-sb.mpg.de>. 61 * Joerg Dorchain <dorchain@mpi-sb.mpg.de>.
62 * 62 *
63 * 06.11.96 - Added v2 code submitted by Joerg Dorchain, but written by 63 * 06.11.96 - Added v2 code submitted by Joerg Dorchain, but written by
@@ -83,7 +83,7 @@
83 * -f force filesystem check even if filesystem marked as valid 83 * -f force filesystem check even if filesystem marked as valid
84 * 84 *
85 * The device may be a block device or a image of one, but this isn't 85 * The device may be a block device or a image of one, but this isn't
86 * enforced (but it's not much fun on a character device :-). 86 * enforced (but it's not much fun on a character device :-).
87 */ 87 */
88 88
89#include <stdio.h> 89#include <stdio.h>
@@ -1312,7 +1312,7 @@ static void free_name_list(void)
1312{ 1312{
1313 int i; 1313 int i;
1314 1314
1315 if (name_list) { 1315 if (name_list) {
1316 for (i = 0; i < MAX_DEPTH; i++) { 1316 for (i = 0; i < MAX_DEPTH; i++) {
1317 free(name_list[i]); 1317 free(name_list[i]);
1318 } 1318 }
@@ -1396,7 +1396,7 @@ extern int fsck_minix_main(int argc, char **argv)
1396 /* 1396 /*
1397 * Determine whether or not we should continue with the checking. 1397 * Determine whether or not we should continue with the checking.
1398 * This is based on the status of the filesystem valid and error 1398 * This is based on the status of the filesystem valid and error
1399 * flags and whether or not the -f switch was specified on the 1399 * flags and whether or not the -f switch was specified on the
1400 * command line. 1400 * command line.
1401 */ 1401 */
1402 printf("%s, %s\n", bb_applet_name, program_version); 1402 printf("%s, %s\n", bb_applet_name, program_version);
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
index e089b1d81..fae511f9c 100644
--- a/util-linux/hwclock.c
+++ b/util-linux/hwclock.c
@@ -46,7 +46,7 @@ struct linux_rtc_time {
46 int tm_yday; 46 int tm_yday;
47 int tm_isdst; 47 int tm_isdst;
48}; 48};
49 49
50#define RTC_SET_TIME _IOW('p', 0x0a, struct linux_rtc_time) /* Set RTC time */ 50#define RTC_SET_TIME _IOW('p', 0x0a, struct linux_rtc_time) /* Set RTC time */
51#define RTC_RD_TIME _IOR('p', 0x09, struct linux_rtc_time) /* Read RTC time */ 51#define RTC_RD_TIME _IOR('p', 0x09, struct linux_rtc_time) /* Read RTC time */
52 52
@@ -71,17 +71,17 @@ static time_t read_rtc(int utc)
71 if ( ioctl ( rtc, RTC_RD_TIME, &tm ) < 0 ) 71 if ( ioctl ( rtc, RTC_RD_TIME, &tm ) < 0 )
72 bb_perror_msg_and_die ( "Could not read time from RTC" ); 72 bb_perror_msg_and_die ( "Could not read time from RTC" );
73 tm. tm_isdst = -1; // not known 73 tm. tm_isdst = -1; // not known
74 74
75 close ( rtc ); 75 close ( rtc );
76 76
77 if ( utc ) { 77 if ( utc ) {
78 oldtz = getenv ( "TZ" ); 78 oldtz = getenv ( "TZ" );
79 setenv ( "TZ", "UTC 0", 1 ); 79 setenv ( "TZ", "UTC 0", 1 );
80 tzset ( ); 80 tzset ( );
81 } 81 }
82 82
83 t = mktime ( &tm ); 83 t = mktime ( &tm );
84 84
85 if ( utc ) { 85 if ( utc ) {
86 if ( oldtz ) 86 if ( oldtz )
87 setenv ( "TZ", oldtz, 1 ); 87 setenv ( "TZ", oldtz, 1 );
@@ -101,13 +101,13 @@ static void write_rtc(time_t t, int utc)
101 if (( rtc = open ( "/dev/misc/rtc", O_WRONLY )) < 0 ) 101 if (( rtc = open ( "/dev/misc/rtc", O_WRONLY )) < 0 )
102 bb_perror_msg_and_die ( "Could not access RTC" ); 102 bb_perror_msg_and_die ( "Could not access RTC" );
103 } 103 }
104 104
105 tm = *( utc ? gmtime ( &t ) : localtime ( &t )); 105 tm = *( utc ? gmtime ( &t ) : localtime ( &t ));
106 tm. tm_isdst = 0; 106 tm. tm_isdst = 0;
107 107
108 if ( ioctl ( rtc, RTC_SET_TIME, &tm ) < 0 ) 108 if ( ioctl ( rtc, RTC_SET_TIME, &tm ) < 0 )
109 bb_perror_msg_and_die ( "Could not set the RTC time" ); 109 bb_perror_msg_and_die ( "Could not set the RTC time" );
110 110
111 close ( rtc ); 111 close ( rtc );
112} 112}
113 113
@@ -117,16 +117,16 @@ static int show_clock(int utc)
117 time_t t; 117 time_t t;
118 char buffer [64]; 118 char buffer [64];
119 119
120 t = read_rtc ( utc ); 120 t = read_rtc ( utc );
121 ptm = localtime ( &t ); /* Sets 'tzname[]' */ 121 ptm = localtime ( &t ); /* Sets 'tzname[]' */
122 122
123 safe_strncpy ( buffer, ctime ( &t ), sizeof( buffer )); 123 safe_strncpy ( buffer, ctime ( &t ), sizeof( buffer ));
124 if ( buffer [0] ) 124 if ( buffer [0] )
125 buffer [bb_strlen ( buffer ) - 1] = 0; 125 buffer [bb_strlen ( buffer ) - 1] = 0;
126 126
127 //printf ( "%s %.6f seconds %s\n", buffer, 0.0, utc ? "" : ( ptm-> tm_isdst ? tzname [1] : tzname [0] )); 127 //printf ( "%s %.6f seconds %s\n", buffer, 0.0, utc ? "" : ( ptm-> tm_isdst ? tzname [1] : tzname [0] ));
128 printf ( "%s %.6f seconds\n", buffer, 0.0 ); 128 printf ( "%s %.6f seconds\n", buffer, 0.0 );
129 129
130 return 0; 130 return 0;
131} 131}
132 132
@@ -134,7 +134,7 @@ static int to_sys_clock(int utc)
134{ 134{
135 struct timeval tv = { 0, 0 }; 135 struct timeval tv = { 0, 0 };
136 const struct timezone tz = { timezone/60 - 60*daylight, 0 }; 136 const struct timezone tz = { timezone/60 - 60*daylight, 0 };
137 137
138 tv. tv_sec = read_rtc ( utc ); 138 tv. tv_sec = read_rtc ( utc );
139 139
140 if ( settimeofday ( &tv, &tz )) 140 if ( settimeofday ( &tv, &tz ))
@@ -160,18 +160,18 @@ static int check_utc(void)
160{ 160{
161 int utc = 0; 161 int utc = 0;
162 FILE *f = fopen ( "/var/lib/hwclock/adjtime", "r" ); 162 FILE *f = fopen ( "/var/lib/hwclock/adjtime", "r" );
163 163
164 if ( f ) { 164 if ( f ) {
165 char buffer [128]; 165 char buffer [128];
166 166
167 while ( fgets ( buffer, sizeof( buffer ), f )) { 167 while ( fgets ( buffer, sizeof( buffer ), f )) {
168 int len = bb_strlen ( buffer ); 168 int len = bb_strlen ( buffer );
169 169
170 while ( len && isspace ( buffer [len - 1] )) 170 while ( len && isspace ( buffer [len - 1] ))
171 len--; 171 len--;
172 172
173 buffer [len] = 0; 173 buffer [len] = 0;
174 174
175 if ( strncmp ( buffer, "UTC", 3 ) == 0 ) { 175 if ( strncmp ( buffer, "UTC", 3 ) == 0 ) {
176 utc = 1; 176 utc = 1;
177 break; 177 break;
@@ -224,6 +224,6 @@ static const struct option hwclock_long_options[] = {
224 return from_sys_clock ( utc ); 224 return from_sys_clock ( utc );
225 } else { 225 } else {
226 /* default HWCLOCK_OPT_SHOW */ 226 /* default HWCLOCK_OPT_SHOW */
227 return show_clock ( utc ); 227 return show_clock ( utc );
228 } 228 }
229} 229}
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 0f72b3592..3c140ef2a 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -35,7 +35,7 @@
35 * 35 *
36 * 30.10.94 - added support for v2 filesystem 36 * 30.10.94 - added support for v2 filesystem
37 * (Andreas Schwab, schwab@issan.informatik.uni-dortmund.de) 37 * (Andreas Schwab, schwab@issan.informatik.uni-dortmund.de)
38 * 38 *
39 * 09.11.94 - Added test to prevent overwrite of mounted fs adapted 39 * 09.11.94 - Added test to prevent overwrite of mounted fs adapted
40 * from Theodore Ts'o's (tytso@athena.mit.edu) mke2fs 40 * from Theodore Ts'o's (tytso@athena.mit.edu) mke2fs
41 * program. (Daniel Quinlan, quinlan@yggdrasil.com) 41 * program. (Daniel Quinlan, quinlan@yggdrasil.com)
@@ -56,7 +56,7 @@
56 * -v for v2 filesystem 56 * -v for v2 filesystem
57 * 57 *
58 * The device may be a block device or a image of one, but this isn't 58 * The device may be a block device or a image of one, but this isn't
59 * enforced (but it's not much fun on a character device :-). 59 * enforced (but it's not much fun on a character device :-).
60 * 60 *
61 * Modified for BusyBox by Erik Andersen <andersen@debian.org> -- 61 * Modified for BusyBox by Erik Andersen <andersen@debian.org> --
62 * removed getopt based parser and added a hand rolled one. 62 * removed getopt based parser and added a hand rolled one.
@@ -702,7 +702,7 @@ extern int mkfs_minix_main(int argc, char **argv)
702 if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) 702 if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
703 bb_error_msg_and_die("bad inode size"); 703 bb_error_msg_and_die("bad inode size");
704#endif 704#endif
705 705
706 /* Parse options */ 706 /* Parse options */
707 argv++; 707 argv++;
708 while (--argc >= 0 && *argv && **argv) { 708 while (--argc >= 0 && *argv && **argv) {
@@ -755,7 +755,7 @@ extern int mkfs_minix_main(int argc, char **argv)
755 magic = MINIX_SUPER_MAGIC; 755 magic = MINIX_SUPER_MAGIC;
756 else if (i == 30) 756 else if (i == 30)
757 magic = MINIX_SUPER_MAGIC2; 757 magic = MINIX_SUPER_MAGIC2;
758 else 758 else
759 bb_show_usage(); 759 bb_show_usage();
760 namelen = i; 760 namelen = i;
761 dirsize = i + 2; 761 dirsize = i + 2;
diff --git a/util-linux/more.c b/util-linux/more.c
index e3a1d8656..d7b7ce22f 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -3,10 +3,10 @@
3 * Mini more implementation for busybox 3 * Mini more implementation for busybox
4 * 4 *
5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. 5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
6 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * 7 *
8 * Latest version blended together by Erik Andersen <andersen@codepoet.org>, 8 * Latest version blended together by Erik Andersen <andersen@codepoet.org>,
9 * based on the original more implementation by Bruce, and code from the 9 * based on the original more implementation by Bruce, and code from the
10 * Debian boot-floppies team. 10 * Debian boot-floppies team.
11 * 11 *
12 * Termios corrects by Vladimir Oleynik <dzo@simtreas.ru> 12 * Termios corrects by Vladimir Oleynik <dzo@simtreas.ru>
@@ -101,7 +101,7 @@ extern int more_main(int argc, char **argv)
101 file = bb_wfopen(*argv, "r"); 101 file = bb_wfopen(*argv, "r");
102 if(file==0) 102 if(file==0)
103 goto loop; 103 goto loop;
104 104
105 st.st_size = 0; 105 st.st_size = 0;
106 fstat(fileno(file), &st); 106 fstat(fileno(file), &st);
107 107
@@ -158,7 +158,7 @@ extern int more_main(int argc, char **argv)
158 goto end; 158 goto end;
159 } 159 }
160 160
161 /* 161 /*
162 * There are two input streams to worry about here: 162 * There are two input streams to worry about here:
163 * 163 *
164 * c : the character we are reading from the file being "mored" 164 * c : the character we are reading from the file being "mored"
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 8a1f4a11a..098e63663 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -3,7 +3,7 @@
3 * Mini mount implementation for busybox 3 * Mini mount implementation for busybox
4 * 4 *
5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. 5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
6 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -27,8 +27,8 @@
27 * 27 *
28 * 1999-10-07 Erik Andersen <andersen@codepoet.org>. 28 * 1999-10-07 Erik Andersen <andersen@codepoet.org>.
29 * Rewrite of a lot of code. Removed mtab usage (I plan on 29 * Rewrite of a lot of code. Removed mtab usage (I plan on
30 * putting it back as a compile-time option some time), 30 * putting it back as a compile-time option some time),
31 * major adjustments to option parsing, and some serious 31 * major adjustments to option parsing, and some serious
32 * dieting all around. 32 * dieting all around.
33 * 33 *
34 * 1999-11-06 mtab suppport is back - andersee 34 * 1999-11-06 mtab suppport is back - andersee
@@ -40,8 +40,8 @@
40 * Rewrote fstab while loop and lower mount section. Can now do 40 * Rewrote fstab while loop and lower mount section. Can now do
41 * single mounts from fstab. Can override fstab options for single 41 * single mounts from fstab. Can override fstab options for single
42 * mount. Common mount_one call for single mounts and 'all'. Fixed 42 * mount. Common mount_one call for single mounts and 'all'. Fixed
43 * mtab updating and stale entries. Removed 'remount' default. 43 * mtab updating and stale entries. Removed 'remount' default.
44 * 44 *
45 */ 45 */
46 46
47#include <limits.h> 47#include <limits.h>
@@ -289,7 +289,7 @@ static int mount_one(char *blockDevice, char *directory, char *filesystemType,
289 } 289 }
290 290
291 if (read_proc && !status) { 291 if (read_proc && !status) {
292 292
293 f = bb_xfopen("/proc/filesystems", "r"); 293 f = bb_xfopen("/proc/filesystems", "r");
294 294
295 while (fgets(buf, sizeof(buf), f) != NULL) { 295 while (fgets(buf, sizeof(buf), f) != NULL) {
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index 4241f79f5..34f23f5aa 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -24,7 +24,7 @@
24 * 24 *
25 * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org> 25 * 1999-02-22 Arkadiusz Mi¶kiewicz <misiek@misiek.eu.org>
26 * - added Native Language Support 26 * - added Native Language Support
27 * 27 *
28 * Modified by Olaf Kirch and Trond Myklebust for new NFS code, 28 * Modified by Olaf Kirch and Trond Myklebust for new NFS code,
29 * plus NFSv3 stuff. 29 * plus NFSv3 stuff.
30 */ 30 */
@@ -95,7 +95,7 @@ enum nfs_stat {
95 NFSERR_BADTYPE = 10007, /* v3 */ 95 NFSERR_BADTYPE = 10007, /* v3 */
96 NFSERR_JUKEBOX = 10008 /* v3 */ 96 NFSERR_JUKEBOX = 10008 /* v3 */
97}; 97};
98 98
99#define NFS_PROGRAM 100003 99#define NFS_PROGRAM 100003
100 100
101 101
@@ -445,7 +445,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
445 445
446 for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) { 446 for (opt = strtok(old_opts, ","); opt; opt = strtok(NULL, ",")) {
447 if ((opteq = strchr(opt, '='))) { 447 if ((opteq = strchr(opt, '='))) {
448 val = atoi(opteq + 1); 448 val = atoi(opteq + 1);
449 *opteq = '\0'; 449 *opteq = '\0';
450 if (!strcmp(opt, "rsize")) 450 if (!strcmp(opt, "rsize"))
451 data.rsize = val; 451 data.rsize = val;
@@ -515,9 +515,9 @@ int nfsmount(const char *spec, const char *node, int *flags,
515 val = 0; 515 val = 0;
516 opt += 2; 516 opt += 2;
517 } 517 }
518 if (!strcmp(opt, "bg")) 518 if (!strcmp(opt, "bg"))
519 bg = val; 519 bg = val;
520 else if (!strcmp(opt, "fg")) 520 else if (!strcmp(opt, "fg"))
521 bg = !val; 521 bg = !val;
522 else if (!strcmp(opt, "soft")) 522 else if (!strcmp(opt, "soft"))
523 soft = val; 523 soft = val;
@@ -872,7 +872,7 @@ fail:
872 if (fsock != -1) 872 if (fsock != -1)
873 close(fsock); 873 close(fsock);
874 return retval; 874 return retval;
875} 875}
876 876
877/* 877/*
878 * We need to translate between nfs status return values and 878 * We need to translate between nfs status return values and
diff --git a/util-linux/pivot_root.c b/util-linux/pivot_root.c
index 39453a261..85e180c46 100644
--- a/util-linux/pivot_root.c
+++ b/util-linux/pivot_root.c
@@ -4,7 +4,7 @@
4 * 4 *
5 * busyboxed by Evin Robertson 5 * busyboxed by Evin Robertson
6 * pivot_root syscall stubbed by Erik Andersen, so it will compile 6 * pivot_root syscall stubbed by Erik Andersen, so it will compile
7 * regardless of the kernel being used. 7 * regardless of the kernel being used.
8 */ 8 */
9#include <stdlib.h> 9#include <stdlib.h>
10#include <stdio.h> 10#include <stdio.h>
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 9da70756e..7c7031bce 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -2,8 +2,7 @@
2/* 2/*
3 * Mini swapon/swapoff implementation for busybox 3 * Mini swapon/swapoff implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org>
7 * 6 *
8 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 5df597028..37a8f061e 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -2,7 +2,7 @@
2/* 2/*
3 * Mini umount implementation for busybox 3 * Mini umount implementation for busybox
4 * 4 *
5 * Copyright (C) 1999-2003 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by 8 * it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
28#include <stdlib.h> 28#include <stdlib.h>
29#include "busybox.h" 29#include "busybox.h"
30 30
31/* Teach libc5 about realpath -- it includes it but the 31/* Teach libc5 about realpath -- it includes it but the
32 * prototype is missing... */ 32 * prototype is missing... */
33#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1) 33#if (__GLIBC__ <= 2) && (__GLIBC_MINOR__ < 1)
34extern char *realpath(const char *path, char *resolved_path); 34extern char *realpath(const char *path, char *resolved_path);
@@ -148,7 +148,7 @@ static char *mtab_first(void **iter)
148 return mtab_next(iter); 148 return mtab_next(iter);
149} 149}
150 150
151/* Don't bother to clean up, since exit() does that 151/* Don't bother to clean up, since exit() does that
152 * automagically, so we can save a few bytes */ 152 * automagically, so we can save a few bytes */
153#ifdef CONFIG_FEATURE_CLEAN_UP 153#ifdef CONFIG_FEATURE_CLEAN_UP
154static void mtab_free(void) 154static void mtab_free(void)