summaryrefslogtreecommitdiff
authorTanguy Pruvot <tanguy.pruvot@gmail.com>2011-07-08 13:11:23 (GMT)
committer Tanguy Pruvot <tanguy.pruvot@gmail.com>2011-07-08 13:11:23 (GMT)
commitb12cc7b2677f276134c5f88bbb6baecbbe2e31bc (patch)
tree1e9e4d67a26e89c163888e37713d179c5a43c0b3
parentdfd4156f8cab9f40a8024828e9519830c9f98c7b (diff)
parent98f213ed7940d70a5ba7ea502469e51da8b0a2b0 (diff)
downloadbusybox-b12cc7b2677f276134c5f88bbb6baecbbe2e31bc.zip
busybox-b12cc7b2677f276134c5f88bbb6baecbbe2e31bc.tar.gz
busybox-b12cc7b2677f276134c5f88bbb6baecbbe2e31bc.tar.bz2
Merge branch 'busybox' into gingerbread
Conflicts: coreutils/usleep.c libbb/inet_common.c networking/ping.c networking/telnet.c util-linux/acpid.c util-linux/swaponoff.c
Diffstat
-rw-r--r--INSTALL6
-rw-r--r--Makefile11
-rw-r--r--Makefile.help4
-rw-r--r--README4
-rw-r--r--configs/TEST_nommu_defconfig (renamed from TEST_config_nommu)0
-rw-r--r--configs/TEST_noprintf_defconfig (renamed from TEST_config_noprintf)0
-rw-r--r--configs/TEST_rh9_defconfig (renamed from TEST_config_rh9)0
-rw-r--r--coreutils/usleep.c6
-rw-r--r--docs/unicode.txt2
-rw-r--r--editors/diff.c2
-rw-r--r--include/platform.h15
-rw-r--r--init/halt.c2
-rw-r--r--libbb/Kbuild.src10
-rw-r--r--libbb/inet_common.c6
-rw-r--r--miscutils/adjtimex.c6
-rw-r--r--miscutils/nandwrite.c2
-rw-r--r--miscutils/setserial.c2
-rw-r--r--networking/dnsd.c2
-rw-r--r--networking/ping.c24
-rw-r--r--networking/telnet.c28
-rwxr-xr-xscripts/bloat-o-meter4
-rw-r--r--scripts/kconfig/Makefile2
-rw-r--r--util-linux/acpid.c6
-rw-r--r--util-linux/hwclock.c26
-rw-r--r--util-linux/lspci.c2
-rw-r--r--util-linux/swaponoff.c10
26 files changed, 102 insertions, 80 deletions
diff --git a/INSTALL b/INSTALL
index ec2b028..f93e5fb 100644
--- a/INSTALL
+++ b/INSTALL
@@ -70,7 +70,9 @@ create a known starting point.
Other starting configurations (mostly used for testing purposes) include
"make allbareconfig" (enables all applets but disables all optional features),
"make allyesconfig" (enables absolutely everything including debug features),
-and "make randconfig" (produce a random configuration).
+and "make randconfig" (produce a random configuration). The configs/ directory
+contains a number of additional configuration files ending in _defconfig which
+are useful in specific cases. "make help" will list them.
Configuring BusyBox produces a file ".config", which can be saved for future
use. Run "make oldconfig" to bring a .config file from an older version of
@@ -97,7 +99,7 @@ first argument to determine which applet to behave as, for example
"./busybox cat LICENSE". (Running the busybox applet with no arguments gives
a list of all enabled applets.) The standalone shell can also call busybox
applets without links to busybox under other names in the filesystem. You can
-also configure a standaone install capability into the busybox base applet,
+also configure a standalone install capability into the busybox base applet,
and then install such links at runtime with one of "busybox --install" (for
hardlinks) or "busybox --install -s" (for symlinks).
diff --git a/Makefile b/Makefile
index d4a0034..60ea1e8 100644
--- a/Makefile
+++ b/Makefile
@@ -1042,7 +1042,7 @@ rpm: FORCE
# Brief documentation of the typical targets used
# ---------------------------------------------------------------------------
-boards := $(wildcard $(srctree)/arch/$(ARCH)/configs/*_defconfig)
+boards := $(wildcard $(srctree)/configs/*_defconfig)
boards := $(notdir $(boards))
-include $(srctree)/Makefile.help
@@ -1131,15 +1131,6 @@ clean: $(clean-dirs)
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
-type f -print | xargs rm -f
-help:
- @echo ' Building external modules.'
- @echo ' Syntax: make -C path/to/kernel/src M=$$PWD target'
- @echo ''
- @echo ' modules - default target, build the module(s)'
- @echo ' modules_install - install the module'
- @echo ' clean - remove generated files in module directory only'
- @echo ''
-
# Dummies...
PHONY += prepare scripts
prepare: ;
diff --git a/Makefile.help b/Makefile.help
index 999d029..119dd6f 100644
--- a/Makefile.help
+++ b/Makefile.help
@@ -25,6 +25,10 @@ help:
@echo ' You can use these commands if the commands on the host'
@echo ' is unusable. Afterwards use it like:'
@echo ' make SED="$(objtree)/sed"'
+ @$(if $(boards), \
+ $(foreach b, $(boards), \
+ printf " %-21s - Build for %s\\n" $(b) $(subst _defconfig,,$(b));) \
+ echo '')
@echo
@echo 'Installation:'
@echo ' install - install busybox into CONFIG_PREFIX'
diff --git a/README b/README
index 3fabbb3..e8d9302 100644
--- a/README
+++ b/README
@@ -66,7 +66,7 @@ Using busybox:
run (I.E. "./busybox ls -l /proc").
The "standalone shell" mode is an easy way to try out busybox; this is a
- command shell that calls the builtin applets without needing them to be
+ command shell that calls the built-in applets without needing them to be
installed in the path. (Note that this requires /proc to be mounted, if
testing from a boot floppy or in a chroot environment.)
@@ -191,7 +191,7 @@ Portability:
MacOS X, Solaris, Cygwin, or the BSD Fork Du Jour). This generally involves
a different kernel and a different C library at the same time. While it
should be possible to port the majority of the code to work in one of
- these environments, don't be suprised if it doesn't work out of the box. If
+ these environments, don't be surprised if it doesn't work out of the box. If
you're into that sort of thing, start small (selecting just a few applets)
and work your way up.
diff --git a/TEST_config_nommu b/configs/TEST_nommu_defconfig
index 905f652..905f652 100644
--- a/TEST_config_nommu
+++ b/configs/TEST_nommu_defconfig
diff --git a/TEST_config_noprintf b/configs/TEST_noprintf_defconfig
index b72e128..b72e128 100644
--- a/TEST_config_noprintf
+++ b/configs/TEST_noprintf_defconfig
diff --git a/TEST_config_rh9 b/configs/TEST_rh9_defconfig
index 23094e3..23094e3 100644
--- a/TEST_config_rh9
+++ b/configs/TEST_rh9_defconfig
diff --git a/coreutils/usleep.c b/coreutils/usleep.c
index d5b8873..2e4eb57 100644
--- a/coreutils/usleep.c
+++ b/coreutils/usleep.c
@@ -29,13 +29,7 @@ int usleep_main(int argc UNUSED_PARAM, char **argv)
bb_show_usage();
}
-#ifdef __BIONIC__
usleep(xatou(argv[1]));
-#else
- if (usleep(xatou(argv[1]))) {
- bb_perror_nomsg_and_die();
- }
-#endif
return EXIT_SUCCESS;
}
diff --git a/docs/unicode.txt b/docs/unicode.txt
index 32df24d..9c159ce 100644
--- a/docs/unicode.txt
+++ b/docs/unicode.txt
@@ -29,7 +29,7 @@ But we also need to handle the following problematic moments:
Editors (vi, ed)
This case is a bit similar to "shell input", but unlike shell,
-editors may encounder many more unexpected unicode sequences
+editors may encounter many more unexpected unicode sequences
(try to load a random binary file...), and they need to preserve
them, unlike shell which can afford to drop bogus input.
diff --git a/editors/diff.c b/editors/diff.c
index 0b24ad4..c2d7999 100644
--- a/editors/diff.c
+++ b/editors/diff.c
@@ -699,6 +699,8 @@ static int diffreg(char *file[2])
fp[0] = stdin;
fp[1] = stdin;
+ fp[0] = stdin;
+ fp[1] = stdin;
for (i = 0; i < 2; i++) {
int fd = open_or_warn_stdin(file[i]);
if (fd == -1)
diff --git a/include/platform.h b/include/platform.h
index 78e4f78..c93a569 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -116,7 +116,7 @@
/* Make all declarations hidden (-fvisibility flag only affects definitions) */
/* (don't include system headers after this until corresponding pop!) */
-#if __GNUC_PREREQ(4,1)
+#if __GNUC_PREREQ(4,1) && !defined(__CYGWIN__)
# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)")
# define POP_SAVED_FUNCTION_VISIBILITY _Pragma("GCC visibility pop")
#else
@@ -336,6 +336,10 @@ typedef unsigned smalluint;
# endif
#endif
+#if defined(__CYGWIN__)
+# define MAXSYMLINKS SYMLOOP_MAX
+#endif
+
/* ---- Who misses what? ------------------------------------ */
@@ -396,6 +400,15 @@ typedef unsigned smalluint;
# undef HAVE_NET_ETHERNET_H
#endif
+#if defined(__CYGWIN__)
+# undef HAVE_CLEARENV
+# undef HAVE_FDPRINTF
+# undef HAVE_MEMRCHR
+# undef HAVE_PTSNAME_R
+# undef HAVE_STRVERSCMP
+# undef HAVE_UNLOCKED_LINE_OPS
+#endif
+
/* These BSD-derived OSes share many similarities */
#if (defined __digital__ && defined __unix__) \
|| defined __APPLE__ \
diff --git a/init/halt.c b/init/halt.c
index e7faa67..7c92d5e 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -175,7 +175,7 @@ int halt_main(int argc UNUSED_PARAM, char **argv)
which == 2 ? "6" : "0",
(char *)NULL
);
- perror_msg_and_die("can't execute '%s'",
+ bb_perror_msg_and_die("can't execute '%s'",
CONFIG_TELINIT_PATH);
}
}
diff --git a/libbb/Kbuild.src b/libbb/Kbuild.src
index a6e80e6..875d024 100644
--- a/libbb/Kbuild.src
+++ b/libbb/Kbuild.src
@@ -97,7 +97,6 @@ lib-y += strrstr.o
lib-y += time.o
lib-y += trim.o
lib-y += u_signal_names.o
-lib-y += udp_io.o
lib-y += uuencode.o
lib-y += vdprintf.o
lib-y += verror_msg.o
@@ -127,6 +126,15 @@ lib-$(CONFIG_FEATURE_MTAB_SUPPORT) += mtab.o
lib-$(CONFIG_UNICODE_SUPPORT) += unicode.o
lib-$(CONFIG_FEATURE_CHECK_NAMES) += die_if_bad_username.o
+lib-$(CONFIG_NC) += udp_io.o
+lib-$(CONFIG_DNSD) += udp_io.o
+lib-$(CONFIG_NTPD) += udp_io.o
+lib-$(CONFIG_TFTP) += udp_io.o
+lib-$(CONFIG_TFTPD) += udp_io.o
+lib-$(CONFIG_TCPSVD) += udp_io.o
+lib-$(CONFIG_UDPSVD) += udp_io.o
+lib-$(CONFIG_TRACEROUTE) += udp_io.o
+
lib-$(CONFIG_LOSETUP) += loop.o
lib-$(CONFIG_FEATURE_MOUNT_LOOP) += loop.o
diff --git a/libbb/inet_common.c b/libbb/inet_common.c
index 6aa68c8..603aa05 100644
--- a/libbb/inet_common.c
+++ b/libbb/inet_common.c
@@ -174,8 +174,10 @@ int FAST_FUNC INET6_resolve(const char *name, struct sockaddr_in6 *sin6)
bb_error_msg("getaddrinfo: %s: %d", name, s);
return -1;
}
- memcpy(sin6, ai->ai_addr, sizeof(struct sockaddr_in6));
- if (ai) freeaddrinfo(ai);
+ //memcpy(sin6, ai->ai_addr, sizeof(struct sockaddr_in6));
+ memcpy(sin6, ai->ai_addr, sizeof(*sin6));
+ if (ai)
+ freeaddrinfo(ai);
return 0;
}
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c
index 98b6ccf..c8816e9 100644
--- a/miscutils/adjtimex.c
+++ b/miscutils/adjtimex.c
@@ -23,7 +23,11 @@
//usage: "\n -p TCONST"
#include "libbb.h"
-#include <sys/timex.h>
+#ifdef __BIONIC__
+# include <linux/timex.h>
+#else
+# include <sys/timex.h>
+#endif
static const uint16_t statlist_bit[] = {
STA_PLL,
diff --git a/miscutils/nandwrite.c b/miscutils/nandwrite.c
index 768aed1..562a342 100644
--- a/miscutils/nandwrite.c
+++ b/miscutils/nandwrite.c
@@ -38,7 +38,7 @@
//usage:#define nanddump_trivial_usage
//usage: "[-o] [-b] [-s ADDR] [-f FILE] MTD_DEVICE"
//usage:#define nanddump_full_usage "\n\n"
-//usage: "Dump the sepcified MTD device\n"
+//usage: "Dump the specified MTD device\n"
//usage: "\n -o Omit oob data"
//usage: "\n -b Omit bad block from the dump"
//usage: "\n -s ADDR Start address"
diff --git a/miscutils/setserial.c b/miscutils/setserial.c
index 26902a2..2a034e3 100644
--- a/miscutils/setserial.c
+++ b/miscutils/setserial.c
@@ -11,7 +11,7 @@
//config:config SETSERIAL
//config: bool "setserial"
//config: default y
-//config: depends on PLATFORM_LINUX
+//config: select PLATFORM_LINUX
//config: help
//config: Retrieve or set Linux serial port.
diff --git a/networking/dnsd.c b/networking/dnsd.c
index d80306d..fe98400 100644
--- a/networking/dnsd.c
+++ b/networking/dnsd.c
@@ -30,7 +30,7 @@
//usage: "\n -s Send successful replies only. Use this if you want"
//usage: "\n to use /etc/resolv.conf with two nameserver lines:"
//usage: "\n nameserver DNSD_SERVER"
-//usage: "\n nameserver NORNAL_DNS_SERVER"
+//usage: "\n nameserver NORMAL_DNS_SERVER"
#include "libbb.h"
#include <syslog.h>
diff --git a/networking/ping.c b/networking/ping.c
index 9df1ae1..5ed355c 100644
--- a/networking/ping.c
+++ b/networking/ping.c
@@ -31,18 +31,18 @@
#ifdef __BIONIC__
/* should be in netinet/ip_icmp.h */
-#define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
-#define ICMP_SOURCE_QUENCH 4 /* Source Quench */
-#define ICMP_REDIRECT 5 /* Redirect (change route) */
-#define ICMP_ECHO 8 /* Echo Request */
-#define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
-#define ICMP_PARAMETERPROB 12 /* Parameter Problem */
-#define ICMP_TIMESTAMP 13 /* Timestamp Request */
-#define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
-#define ICMP_INFO_REQUEST 15 /* Information Request */
-#define ICMP_INFO_REPLY 16 /* Information Reply */
-#define ICMP_ADDRESS 17 /* Address Mask Request */
-#define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
+# define ICMP_DEST_UNREACH 3 /* Destination Unreachable */
+# define ICMP_SOURCE_QUENCH 4 /* Source Quench */
+# define ICMP_REDIRECT 5 /* Redirect (change route) */
+# define ICMP_ECHO 8 /* Echo Request */
+# define ICMP_TIME_EXCEEDED 11 /* Time Exceeded */
+# define ICMP_PARAMETERPROB 12 /* Parameter Problem */
+# define ICMP_TIMESTAMP 13 /* Timestamp Request */
+# define ICMP_TIMESTAMPREPLY 14 /* Timestamp Reply */
+# define ICMP_INFO_REQUEST 15 /* Information Request */
+# define ICMP_INFO_REPLY 16 /* Information Reply */
+# define ICMP_ADDRESS 17 /* Address Mask Request */
+# define ICMP_ADDRESSREPLY 18 /* Address Mask Reply */
#endif
//config:config PING
diff --git a/networking/telnet.c b/networking/telnet.c
index 9781263..e8e51dc 100644
--- a/networking/telnet.c
+++ b/networking/telnet.c
@@ -42,25 +42,23 @@
#ifdef __BIONIC__
/* should be in arpa/telnet.h */
-#define IAC 255 /* interpret as command: */
-#define DONT 254 /* you are not to use option */
-#define DO 253 /* please, you use option */
-#define WONT 252 /* I won't use option */
-#define WILL 251 /* I will use option */
-#define SB 250 /* interpret as subnegotiation */
-#define SE 240 /* end sub negotiation */
-#define TELOPT_ECHO 1 /* echo */
-#define TELOPT_SGA 3 /* suppress go ahead */
-#define TELOPT_TTYPE 24 /* terminal type */
-#define TELOPT_NAWS 31 /* window size */
-#else
-#include <arpa/telnet.h>
+# define IAC 255 /* interpret as command: */
+# define DONT 254 /* you are not to use option */
+# define DO 253 /* please, you use option */
+# define WONT 252 /* I won't use option */
+# define WILL 251 /* I will use option */
+# define SB 250 /* interpret as subnegotiation */
+# define SE 240 /* end sub negotiation */
+# define TELOPT_ECHO 1 /* echo */
+# define TELOPT_SGA 3 /* suppress go ahead */
+# define TELOPT_TTYPE 24 /* terminal type */
+# define TELOPT_NAWS 31 /* window size */
#endif
#ifdef DOTRACE
-#define TRACE(x, y) do { if (x) printf y; } while (0)
+# define TRACE(x, y) do { if (x) printf y; } while (0)
#else
-#define TRACE(x, y)
+# define TRACE(x, y)
#endif
enum {
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 91374c1..0d3ff7f 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -1,8 +1,8 @@
-#!/usr/bin/python
+#!/usr/bin/env python
#
# Copyright 2004 Matt Mackall <mpm@selenic.com>
#
-# inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen
+# Inspired by perl Bloat-O-Meter (c) 1997 by Andi Kleen
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index b5708e2..1651390 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -87,7 +87,7 @@ endif
$(MTIME_IS_COARSE) && sleep 1
%_defconfig: $(obj)/conf
- $(Q)$< -D $@ Config.in
+ $(Q)$< -D configs/$@ Config.in
$(MTIME_IS_COARSE) && sleep 1
# Help text used by make help
diff --git a/util-linux/acpid.c b/util-linux/acpid.c
index f39a788..6e7321b 100644
--- a/util-linux/acpid.c
+++ b/util-linux/acpid.c
@@ -33,7 +33,6 @@
#include <syslog.h>
#include <linux/input.h>
-
#ifndef EV_SW
# define EV_SW 0x05
#endif
@@ -47,13 +46,12 @@
# define SW_RFKILL_ALL 0x03
#endif
#ifndef KEY_POWER
-# define KEY_POWER 116 /* SC System Power Down */
+# define KEY_POWER 116 /* SC System Power Down */
#endif
#ifndef KEY_SLEEP
-# define KEY_SLEEP 142 /* SC System Sleep */
+# define KEY_SLEEP 142 /* SC System Sleep */
#endif
-
enum {
OPT_c = (1 << 0),
OPT_d = (1 << 1),
diff --git a/util-linux/hwclock.c b/util-linux/hwclock.c
index 3e2c2aa..6b4e29b 100644
--- a/util-linux/hwclock.c
+++ b/util-linux/hwclock.c
@@ -60,25 +60,31 @@ static void show_clock(const char **pp_rtcname, int utc)
#if SHOW_HWCLOCK_DIFF
struct timeval sys_tv;
#endif
- time_t t;
- char *cp;
+ time_t t = read_rtc(pp_rtcname, &sys_tv, utc);
- t = read_rtc(pp_rtcname, &sys_tv, utc);
- cp = ctime(&t);
+#if ENABLE_LOCALE_SUPPORT
+ /* Standard hwclock uses locale-specific output format */
+ char cp[64];
+ struct tm *ptm = localtime(&t);
+ strftime(cp, sizeof(cp), "%c", ptm);
+#else
+ char *cp = ctime(&t);
strchrnul(cp, '\n')[0] = '\0';
+#endif
+
#if !SHOW_HWCLOCK_DIFF
printf("%s 0.000000 seconds\n", cp);
#else
{
long diff = sys_tv.tv_sec - t;
if (diff < 0 /*&& tv.tv_usec != 0*/) {
- /* Why? */
- /* diff >= 0 is ok: diff < 0, can't just use tv.tv_usec: */
- /* 45.520820 43.520820 */
- /* - 44.000000 - 45.000000 */
- /* = 1.520820 = -1.479180, not -2.520820! */
+ /* Why we need diff++? */
+ /* diff >= 0 is ok: | diff < 0, can't just use tv.tv_usec: */
+ /* 45.520820 | 43.520820 */
+ /* - 44.000000 | - 45.000000 */
+ /* = 1.520820 | = -1.479180, not -2.520820! */
diff++;
- /* should be 1000000 - tv.tv_usec, but then we must check tv.tv_usec != 0 */
+ /* Should be 1000000 - tv.tv_usec, but then we must check tv.tv_usec != 0 */
sys_tv.tv_usec = 999999 - sys_tv.tv_usec;
}
printf("%s %ld.%06lu seconds\n", cp, diff, (unsigned long)sys_tv.tv_usec);
diff --git a/util-linux/lspci.c b/util-linux/lspci.c
index f59aec8..5184858 100644
--- a/util-linux/lspci.c
+++ b/util-linux/lspci.c
@@ -12,7 +12,7 @@
//usage:#define lspci_full_usage "\n\n"
//usage: "List all PCI devices"
//usage: "\n"
-//usage: "\n -m Parseable output"
+//usage: "\n -m Parsable output"
//usage: "\n -k Show driver"
#include "libbb.h"
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 4905f09..7f753b6 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -25,11 +25,7 @@
#include "libbb.h"
#include <mntent.h>
#ifndef __BIONIC__
-#include <sys/swap.h>
-#endif
-
-#ifndef MNTTYPE_SWAP
-#define MNTTYPE_SWAP "swap"
+# include <sys/swap.h>
#endif
#if ENABLE_FEATURE_MOUNT_LABEL
@@ -38,6 +34,10 @@
# define resolve_mount_spec(fsname) ((void)0)
#endif
+#ifndef MNTTYPE_SWAP
+# define MNTTYPE_SWAP "swap"
+#endif
+
#if ENABLE_FEATURE_SWAPON_PRI
struct globals {
int flags;