This directory was fallout from the great feature freeze of 2003, which led
up to the 1.00 release. I just moved what was left of it to http://busybox.net/~landley/pending because it does _not_ belong in the tree anymore.
This commit is contained in:
parent
747041955e
commit
1449a2014a
@ -1,377 +0,0 @@
|
|||||||
Index: coreutils/Config.in
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/coreutils/Config.in,v
|
|
||||||
retrieving revision 1.24
|
|
||||||
diff -u -r1.24 Config.in
|
|
||||||
--- a/coreutils/Config.in 15 Mar 2004 08:28:19 -0000 1.24
|
|
||||||
+++ b/coreutils/Config.in 31 Mar 2004 11:51:17 -0000
|
|
||||||
@@ -59,6 +59,21 @@
|
|
||||||
cmp is used to compare two files and returns the result
|
|
||||||
to standard output.
|
|
||||||
|
|
||||||
+config CONFIG_FEATURE_CMP_SKIP
|
|
||||||
+ bool " Enable optional arguments SKIP1 and SKIP2"
|
|
||||||
+ default n
|
|
||||||
+ depends on CONFIG_CMP
|
|
||||||
+ help
|
|
||||||
+ SKIP1 and SKIP2 specify how many bytes to ignore
|
|
||||||
+ at the start of each file.
|
|
||||||
+
|
|
||||||
+config CONFIG_FEATURE_CMP_LIMIT
|
|
||||||
+ bool " Enable limit of inputs"
|
|
||||||
+ default n
|
|
||||||
+ depends on CONFIG_CMP
|
|
||||||
+ help
|
|
||||||
+ Enable cmp option (-n).
|
|
||||||
+
|
|
||||||
config CONFIG_CP
|
|
||||||
bool "cp"
|
|
||||||
default n
|
|
||||||
Index: coreutils/cmp.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/coreutils/cmp.c,v
|
|
||||||
retrieving revision 1.9
|
|
||||||
diff -u -r1.9 cmp.c
|
|
||||||
--- a/coreutils/cmp.c 19 Mar 2003 09:11:32 -0000 1.9
|
|
||||||
+++ b/coreutils/cmp.c 31 Mar 2004 11:51:17 -0000
|
|
||||||
@@ -39,6 +39,12 @@
|
|
||||||
#include <unistd.h>
|
|
||||||
#include "busybox.h"
|
|
||||||
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_SKIP
|
|
||||||
+#define MAX_OPTIONAL_ARGS 3
|
|
||||||
+#else
|
|
||||||
+#define MAX_OPTIONAL_ARGS 1
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
static FILE *cmp_xfopen_input(const char *filename)
|
|
||||||
{
|
|
||||||
FILE *fp;
|
|
||||||
@@ -58,12 +64,57 @@
|
|
||||||
static const char fmt_l_opt[] = "%.0s%.0s%d %3o %3o\n"; /* nicer gnu format */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-static const char opt_chars[] = "sl";
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_LIMIT
|
|
||||||
+#define OPTCHR_LIMIT "n:"
|
|
||||||
+#define OPTARG_LIMIT ,&limit_str
|
|
||||||
+#else
|
|
||||||
+#define OPTCHR_LIMIT
|
|
||||||
+#define OPTARG_LIMIT
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+static const char opt_chars[] = "sl" OPTCHR_LIMIT;
|
|
||||||
|
|
||||||
enum {
|
|
||||||
OPT_s = 1,
|
|
||||||
- OPT_l = 2
|
|
||||||
+ OPT_l = 2,
|
|
||||||
+ OPT_n = 4
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_LFS
|
|
||||||
+#define SUFFIX_STRUCT suffix_mult64
|
|
||||||
+#define PARSE_FUNC bb_xgetllarg10_sfx
|
|
||||||
+#else
|
|
||||||
+#define SUFFIX_STRUCT suffix_mult
|
|
||||||
+#define PARSE_FUNC bb_xgetlarg10_sfx
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#if defined(CONFIG_FEATURE_CMP_SKIP) || defined(CONFIG_FEATURE_CMP_LIMIT)
|
|
||||||
+static const struct SUFFIX_STRUCT suffixes[] = {
|
|
||||||
+ { "k", 1UL << 10 },
|
|
||||||
+ { "M", 1UL << 20 },
|
|
||||||
+ { "G", 1UL << 30 },
|
|
||||||
+#ifdef CONFIG_LFS
|
|
||||||
+ { "T", 1ULL << 40 },
|
|
||||||
+ { "P", 1ULL << 50 },
|
|
||||||
+ { "E", 1ULL << 60 },
|
|
||||||
+#endif
|
|
||||||
+ { NULL, 0 }
|
|
||||||
};
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_SKIP
|
|
||||||
+static void skip_input(FILE *fp, off_t skip, const char *filename)
|
|
||||||
+{
|
|
||||||
+ if (skip > 0 && fseeko(fp, skip, SEEK_CUR) != 0) {
|
|
||||||
+ while (skip-- > 0) {
|
|
||||||
+ if (getc(fp) == EOF) {
|
|
||||||
+ bb_xferror(fp, filename);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
int cmp_main(int argc, char **argv)
|
|
||||||
{
|
|
||||||
@@ -73,12 +124,26 @@
|
|
||||||
int c1, c2, char_pos, line_pos;
|
|
||||||
int opt_flags;
|
|
||||||
int exit_val = 0;
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_SKIP
|
|
||||||
+ off_t skip1 = 0, skip2 = 0;
|
|
||||||
+#endif
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_LIMIT
|
|
||||||
+ off_t limit = -1;
|
|
||||||
+ char *limit_str;
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
bb_default_error_retval = 2; /* 1 is returned if files are different. */
|
|
||||||
|
|
||||||
- opt_flags = bb_getopt_ulflags(argc, argv, opt_chars);
|
|
||||||
+ opt_flags = bb_getopt_ulflags(argc, argv, opt_chars OPTARG_LIMIT);
|
|
||||||
|
|
||||||
- if ((opt_flags == 3) || (((unsigned int)(--argc - optind)) > 1)) {
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_LIMIT
|
|
||||||
+ if (opt_flags & OPT_n) {
|
|
||||||
+ limit = PARSE_FUNC(limit_str, suffixes);
|
|
||||||
+ opt_flags &= 3;
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ if ((opt_flags == 3) || (((unsigned int)(--argc - optind)) > MAX_OPTIONAL_ARGS)) {
|
|
||||||
bb_show_usage();
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -87,6 +152,13 @@
|
|
||||||
filename2 = "-";
|
|
||||||
if (*++argv) {
|
|
||||||
filename2 = *argv;
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_SKIP
|
|
||||||
+ if (*++argv) {
|
|
||||||
+ skip1 = PARSE_FUNC(*argv, suffixes);
|
|
||||||
+ if (*++argv)
|
|
||||||
+ skip2 = PARSE_FUNC(*argv, suffixes);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
fp2 = cmp_xfopen_input(filename2);
|
|
||||||
|
|
||||||
@@ -98,6 +170,11 @@
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_SKIP
|
|
||||||
+ skip_input(fp1, skip1, filename1);
|
|
||||||
+ skip_input(fp2, skip2, filename2);
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
fmt = fmt_differ;
|
|
||||||
if (opt_flags == OPT_l) {
|
|
||||||
fmt = fmt_l_opt;
|
|
||||||
@@ -106,6 +183,10 @@
|
|
||||||
char_pos = 0;
|
|
||||||
line_pos = 1;
|
|
||||||
do {
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_LIMIT
|
|
||||||
+ if (limit-- == 0)
|
|
||||||
+ break;
|
|
||||||
+#endif
|
|
||||||
c1 = getc(fp1);
|
|
||||||
c2 = getc(fp2);
|
|
||||||
++char_pos;
|
|
||||||
Index: include/usage.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/include/usage.h,v
|
|
||||||
retrieving revision 1.198
|
|
||||||
diff -u -r1.198 usage.h
|
|
||||||
--- a/include/usage.h 29 Mar 2004 08:20:08 -0000 1.198
|
|
||||||
+++ b/include/usage.h 31 Mar 2004 11:51:17 -0000
|
|
||||||
@@ -186,14 +186,29 @@
|
|
||||||
#define clear_full_usage \
|
|
||||||
"Clear screen."
|
|
||||||
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_SKIP
|
|
||||||
+#define USAGE_CMP_SKIP(a) a
|
|
||||||
+#else
|
|
||||||
+#define USAGE_CMP_SKIP(a)
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_FEATURE_CMP_LIMIT
|
|
||||||
+#define USAGE_CMP_LIMIT(a) a
|
|
||||||
+#else
|
|
||||||
+#define USAGE_CMP_LIMIT(a)
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#define cmp_trivial_usage \
|
|
||||||
- "[OPTION]... FILE1 [FILE2]"
|
|
||||||
+ "[OPTION]... FILE1 [FILE2" USAGE_CMP_SKIP(" [SKIP1 [SKIP2]]") "]"
|
|
||||||
#define cmp_full_usage \
|
|
||||||
- "Compare files.\n\n" \
|
|
||||||
+ "Compare files.\n" \
|
|
||||||
+ USAGE_CMP_SKIP("SKIP1 and SKIP2 are the number of bytes to skip in each file.\n") \
|
|
||||||
+ "\n" \
|
|
||||||
"Options:\n" \
|
|
||||||
- "\t-l\tWrite the byte numbers (decimal) and values (octal)\n" \
|
|
||||||
- "\t\t for all differing bytes.\n" \
|
|
||||||
- "\t-s\tquiet mode - do not print"
|
|
||||||
+ "\t-l\t\tWrite the byte numbers (decimal) and values (octal)\n" \
|
|
||||||
+ "\t\t\t for all differing bytes.\n" \
|
|
||||||
+ USAGE_CMP_LIMIT("\t-n LIMIT\tCompare at most LIMIT bytes.\n") \
|
|
||||||
+ "\t-s\t\tquiet mode - do not print"
|
|
||||||
|
|
||||||
#define cp_trivial_usage \
|
|
||||||
"[OPTION]... SOURCE DEST"
|
|
||||||
Index: include/libbb.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/include/libbb.h,v
|
|
||||||
retrieving revision 1.129
|
|
||||||
diff -u -r1.129 libbb.h
|
|
||||||
--- a/include/libbb.h 15 Mar 2004 08:28:38 -0000 1.129
|
|
||||||
+++ b/include/libbb.h 31 Mar 2004 11:51:17 -0000
|
|
||||||
@@ -217,6 +217,21 @@
|
|
||||||
const struct suffix_mult *suffixes);
|
|
||||||
extern long bb_xgetlarg10_sfx(const char *arg, const struct suffix_mult *suffixes);
|
|
||||||
|
|
||||||
+struct suffix_mult64 {
|
|
||||||
+ const char *suffix;
|
|
||||||
+ unsigned long long mult;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+extern unsigned long long bb_xgetullarg_bnd_sfx(const char *arg, int base,
|
|
||||||
+ unsigned long long lower,
|
|
||||||
+ unsigned long long upper,
|
|
||||||
+ const struct suffix_mult64 *suffixes);
|
|
||||||
+
|
|
||||||
+extern long long bb_xgetllarg_bnd_sfx(const char *arg, int base,
|
|
||||||
+ long long lower,
|
|
||||||
+ long long upper,
|
|
||||||
+ const struct suffix_mult64 *suffixes);
|
|
||||||
+extern long long bb_xgetllarg10_sfx(const char *arg, const struct suffix_mult64 *suffixes);
|
|
||||||
|
|
||||||
//#warning pitchable now?
|
|
||||||
extern unsigned long bb_xparse_number(const char *numstr,
|
|
||||||
Index: libbb/Makefile.in
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/libbb/Makefile.in,v
|
|
||||||
retrieving revision 1.34
|
|
||||||
diff -u -r1.34 Makefile.in
|
|
||||||
--- a/libbb/Makefile.in 6 Mar 2004 22:11:45 -0000 1.34
|
|
||||||
+++ b/libbb/Makefile.in 31 Mar 2004 11:51:17 -0000
|
|
||||||
@@ -70,7 +70,8 @@
|
|
||||||
|
|
||||||
LIBBB_MSRC3:=$(LIBBB_DIR)xgetularg.c
|
|
||||||
LIBBB_MOBJ3:=xgetularg_bnd_sfx.o xgetlarg_bnd_sfx.o getlarg10_sfx.o \
|
|
||||||
- xgetularg_bnd.o xgetularg10_bnd.o xgetularg10.o
|
|
||||||
+ xgetularg_bnd.o xgetularg10_bnd.o xgetularg10.o \
|
|
||||||
+ xgetullarg_bnd_sfx.o xgetllarg_bnd_sfx.o xgetllarg10_sfx.o
|
|
||||||
|
|
||||||
LIBBB_MSRC4:=$(LIBBB_DIR)/safe_strtol.c
|
|
||||||
LIBBB_MOBJ4:=safe_strtoi.o safe_strtod.o safe_strtol.o safe_strtoul.o
|
|
||||||
Index: libbb/xgetularg.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/libbb/xgetularg.c,v
|
|
||||||
retrieving revision 1.2
|
|
||||||
diff -u -r1.2 xgetularg.c
|
|
||||||
--- a/libbb/xgetularg.c 15 Mar 2004 08:28:44 -0000 1.2
|
|
||||||
+++ b/libbb/xgetularg.c 31 Mar 2004 11:51:17 -0000
|
|
||||||
@@ -158,3 +158,106 @@
|
|
||||||
return bb_xgetularg10_bnd(arg, 0, ULONG_MAX);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
+
|
|
||||||
+#ifdef L_xgetullarg_bnd_sfx
|
|
||||||
+extern
|
|
||||||
+unsigned long long bb_xgetullarg_bnd_sfx(const char *arg, int base,
|
|
||||||
+ unsigned long long lower,
|
|
||||||
+ unsigned long long upper,
|
|
||||||
+ const struct suffix_mult64 *suffixes)
|
|
||||||
+{
|
|
||||||
+ unsigned long long r;
|
|
||||||
+ int old_errno;
|
|
||||||
+ char *e;
|
|
||||||
+
|
|
||||||
+ assert(arg);
|
|
||||||
+
|
|
||||||
+ /* Disallow '-' and any leading whitespace. Speed isn't critical here
|
|
||||||
+ * since we're parsing commandline args. So make sure we get the
|
|
||||||
+ * actual isspace function rather than a larger macro implementaion. */
|
|
||||||
+ if ((*arg == '-') || (isspace)(*arg)) {
|
|
||||||
+ bb_show_usage();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Since this is a lib function, we're not allowed to reset errno to 0.
|
|
||||||
+ * Doing so could break an app that is deferring checking of errno.
|
|
||||||
+ * So, save the old value so that we can restore it if successful. */
|
|
||||||
+ old_errno = errno;
|
|
||||||
+ errno = 0;
|
|
||||||
+ r = strtoull(arg, &e, base);
|
|
||||||
+ /* Do the initial validity check. Note: The standards do not
|
|
||||||
+ * guarantee that errno is set if no digits were found. So we
|
|
||||||
+ * must test for this explicitly. */
|
|
||||||
+ if (errno || (arg == e)) { /* error or no digits */
|
|
||||||
+ bb_show_usage();
|
|
||||||
+ }
|
|
||||||
+ errno = old_errno; /* Ok. So restore errno. */
|
|
||||||
+
|
|
||||||
+ /* Do optional suffix parsing. Allow 'empty' suffix tables.
|
|
||||||
+ * Note that we also all nul suffixes with associated multipliers,
|
|
||||||
+ * to allow for scaling of the arg by some default multiplier. */
|
|
||||||
+
|
|
||||||
+ if (suffixes) {
|
|
||||||
+ while (suffixes->suffix) {
|
|
||||||
+ if (strcmp(suffixes->suffix, e) == 0) {
|
|
||||||
+ if (ULONG_LONG_MAX / suffixes->mult < r) { /* Overflow! */
|
|
||||||
+ bb_show_usage();
|
|
||||||
+ }
|
|
||||||
+ ++e;
|
|
||||||
+ r *= suffixes->mult;
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ ++suffixes;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Finally, check for illegal trailing chars and range limits. */
|
|
||||||
+ /* Note: although we allow leading space (via stroul), trailing space
|
|
||||||
+ * is an error. It would be easy enough to allow though if desired. */
|
|
||||||
+ if (*e || (r < lower) || (r > upper)) {
|
|
||||||
+ bb_show_usage();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return r;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#ifdef L_xgetllarg_bnd_sfx
|
|
||||||
+extern
|
|
||||||
+long long bb_xgetllarg_bnd_sfx(const char *arg, int base,
|
|
||||||
+ long long lower,
|
|
||||||
+ long long upper,
|
|
||||||
+ const struct suffix_mult64 *suffixes)
|
|
||||||
+{
|
|
||||||
+ unsigned long long u = LONG_LONG_MAX;
|
|
||||||
+ long long r;
|
|
||||||
+ const char *p = arg;
|
|
||||||
+
|
|
||||||
+ if ((*p == '-') && (p[1] != '+')) {
|
|
||||||
+ ++p;
|
|
||||||
+#if LONG_LONG_MAX == (-(LONG_LONG_MIN + 1))
|
|
||||||
+ ++u; /* two's complement */
|
|
||||||
+#endif
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ r = bb_xgetullarg_bnd_sfx(p, base, 0, u, suffixes);
|
|
||||||
+
|
|
||||||
+ if (*arg == '-') {
|
|
||||||
+ r = -r;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if ((r < lower) || (r > upper)) {
|
|
||||||
+ bb_show_usage();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return r;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#ifdef L_xgetllarg10_sfx
|
|
||||||
+extern
|
|
||||||
+long long bb_xgetllarg10_sfx(const char *arg, const struct suffix_mult64 *suffixes)
|
|
||||||
+{
|
|
||||||
+ return bb_xgetllarg_bnd_sfx(arg, 10, LONG_LONG_MIN, LONG_LONG_MAX, suffixes);
|
|
||||||
+}
|
|
||||||
+#endif
|
|
@ -1,31 +0,0 @@
|
|||||||
Index: Makefile
|
|
||||||
===================================================================
|
|
||||||
--- Makefile (revision 15403)
|
|
||||||
+++ Makefile (working copy)
|
|
||||||
@@ -473,7 +473,7 @@ clean:
|
|
||||||
libbusybox.so* \
|
|
||||||
.config.old busybox busybox_unstripped
|
|
||||||
- rm -r -f _install testsuite/links
|
|
||||||
- - find . -name .\*.flags -o -name \*.o -o -name \*.om \
|
|
||||||
+ - find . -name .\*.flags -o -name \*.o -o -name \*.om -o -name \*.syn \
|
|
||||||
-o -name \*.os -o -name \*.osm -o -name \*.a | xargs rm -f
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
@@ -503,6 +503,17 @@ release: distclean #doc
|
|
||||||
tags:
|
|
||||||
ctags -R .
|
|
||||||
|
|
||||||
+# documentation, cross-reference
|
|
||||||
+# Modern distributions already ship synopsis packages (e.g. debian)
|
|
||||||
+# If you have an old distribution go to http://synopsis.fresco.org/
|
|
||||||
+hdr := $(wildcard $(patsubst %,%/*.h,$(SRC_DIRS)))
|
|
||||||
+syn := $(patsubst %.h, %.syn, $(hdr))
|
|
||||||
+
|
|
||||||
+%.syn: %.h
|
|
||||||
+ synopsis -p C -l Comments.SSDFilter,Comments.Previous $(INCS) -Wp,verbose,debug,preprocess,cppflags="'$(CFLAGS) $(EXTRA_CFLAGS) $(LDFLAGS) $(PROG_CFLAGS) $(PROG_LDFLAGS) $(CFLAGS_COMBINE) $(APPLETS_DEFINE) $(BUSYBOX_DEFINE)'" -o $@ $<
|
|
||||||
+html: $(syn)
|
|
||||||
+ synopsis -f HTML -Wf,title="'BusyBox Documentation'" -o $@ $^
|
|
||||||
+
|
|
||||||
|
|
||||||
endif # ifeq ($(skip-makefile),)
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,51 +0,0 @@
|
|||||||
diff -purN busybox.ori/include/libbb.h busybox/include/libbb.h
|
|
||||||
--- busybox.ori/include/libbb.h 2004-03-21 14:39:35.000000000 +0100
|
|
||||||
+++ busybox-1.0/include/libbb.h 2004-03-21 14:45:35.000000000 +0100
|
|
||||||
@@ -447,6 +447,7 @@ typedef struct {
|
|
||||||
int ppid;
|
|
||||||
#ifdef FEATURE_CPU_USAGE_PERCENTAGE
|
|
||||||
unsigned pcpu;
|
|
||||||
+ unsigned pscpu;
|
|
||||||
unsigned long stime, utime;
|
|
||||||
#endif
|
|
||||||
char *cmd;
|
|
||||||
diff -purN busybox.ori/procps/top.c busybox/procps/top.c
|
|
||||||
--- busybox.ori/procps/top.c 2004-03-21 14:40:09.000000000 +0100
|
|
||||||
+++ busybox-1.0/procps/top.c 2004-03-21 17:27:52.961951448 +0100
|
|
||||||
@@ -289,6 +289,15 @@ static void do_stats(void)
|
|
||||||
i = 999;
|
|
||||||
cur->pcpu = i;
|
|
||||||
|
|
||||||
+ /*
|
|
||||||
+ * Calculate percent of system time from cpu time
|
|
||||||
+ */
|
|
||||||
+ if (systime != 0) {
|
|
||||||
+ cur->pscpu = 100 * total_time / systime;
|
|
||||||
+ } else {
|
|
||||||
+ cur->pscpu = 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
@@ -393,7 +402,7 @@ static void display_status(int count, in
|
|
||||||
|
|
||||||
#ifdef FEATURE_CPU_USAGE_PERCENTAGE
|
|
||||||
/* what info of the processes is shown */
|
|
||||||
- printf("\n\e[7m PID USER STATUS RSS PPID %%CPU %%MEM COMMAND\e[0m\n");
|
|
||||||
+ printf("\n\e[7m PID USER STATUS RSS PPID %%CPU %%SCPU %%MEM COMMAND\e[0m\n");
|
|
||||||
#else
|
|
||||||
printf("\n\e[7m PID USER STATUS RSS PPID %%MEM COMMAND\e[0m\n");
|
|
||||||
#endif
|
|
||||||
@@ -410,9 +419,9 @@ static void display_status(int count, in
|
|
||||||
else
|
|
||||||
sprintf(rss_str_buf, "%7ld", s->rss);
|
|
||||||
#ifdef FEATURE_CPU_USAGE_PERCENTAGE
|
|
||||||
- printf("%5d %-8s %s %s %5d %2d.%d %2u.%u ",
|
|
||||||
+ printf("%5d %-8s %s %s %5d %2d.%d %2d.%d %2u.%u ",
|
|
||||||
s->pid, s->user, s->state, rss_str_buf, s->ppid,
|
|
||||||
- s->pcpu/10, s->pcpu%10, pmem/10, pmem%10);
|
|
||||||
+ s->pcpu/10, s->pcpu%10,s->pscpu/10, s->pscpu%10, pmem/10, pmem%10);
|
|
||||||
#else
|
|
||||||
printf("%5d %-8s %s %s %5d %2u.%u ",
|
|
||||||
s->pid, s->user, s->state, rss_str_buf, s->ppid,
|
|
@ -1,126 +0,0 @@
|
|||||||
Index: include/usage.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/include/usage.h,v
|
|
||||||
retrieving revision 1.191
|
|
||||||
diff -u -r1.191 usage.h
|
|
||||||
--- a/include/usage.h 25 Feb 2004 10:35:55 -0000 1.191
|
|
||||||
+++ b/include/usage.h 5 Mar 2004 14:32:45 -0000
|
|
||||||
@@ -2606,6 +2606,7 @@
|
|
||||||
"\t-p,\t--pidfile=file\tStore process ID of daemon in file\n" \
|
|
||||||
"\t-q,\t--quit\tQuit after obtaining lease\n" \
|
|
||||||
"\t-r,\t--request=IP\tIP address to request (default: none)\n" \
|
|
||||||
+ "\t-R,\t--require=NAME\tAdd NAME to request\n" \
|
|
||||||
"\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
|
|
||||||
"\t-v,\t--version\tDisplay version"
|
|
||||||
|
|
||||||
Index: networking/udhcp/README.udhcpc
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v
|
|
||||||
retrieving revision 1.3
|
|
||||||
diff -u -r1.3 README.udhcpc
|
|
||||||
--- a/networking/udhcp/README.udhcpc 11 Dec 2002 21:12:44 -0000 1.3
|
|
||||||
+++ b/networking/udhcp/README.udhcpc 5 Mar 2004 14:32:46 -0000
|
|
||||||
@@ -22,6 +22,7 @@
|
|
||||||
-p, --pidfile=file Store process ID of daemon in file
|
|
||||||
-q, --quit Quit after obtaining lease
|
|
||||||
-r, --request=IP IP address to request (default: none)
|
|
||||||
+-R, --require=NAME Add NAME to request
|
|
||||||
-s, --script=file Run file at dhcp events (default:
|
|
||||||
/usr/share/udhcpc/default.script)
|
|
||||||
-v, --version Display version
|
|
||||||
@@ -101,6 +102,8 @@
|
|
||||||
|
|
||||||
additional options are easily added in options.c.
|
|
||||||
|
|
||||||
+By default, only a few basic items are requested. To request additional
|
|
||||||
+items use the -R option. Example: "-R rootpath"
|
|
||||||
|
|
||||||
note on udhcpc's random seed
|
|
||||||
---------------------------
|
|
||||||
Index: networking/udhcp/dhcpc.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/dhcpc.c,v
|
|
||||||
retrieving revision 1.16
|
|
||||||
diff -u -r1.16 dhcpc.c
|
|
||||||
--- a/networking/udhcp/dhcpc.c 30 Jan 2004 23:45:12 -0000 1.16
|
|
||||||
+++ b/networking/udhcp/dhcpc.c 5 Mar 2004 14:32:46 -0000
|
|
||||||
@@ -88,6 +88,7 @@
|
|
||||||
" -p, --pidfile=file Store process ID of daemon in file\n"
|
|
||||||
" -q, --quit Quit after obtaining lease\n"
|
|
||||||
" -r, --request=IP IP address to request (default: none)\n"
|
|
||||||
+" -R, --require=NAME Add NAME to the request\n"
|
|
||||||
" -s, --script=file Run file at dhcp events (default:\n"
|
|
||||||
" " DEFAULT_SCRIPT ")\n"
|
|
||||||
" -v, --version Display version\n"
|
|
||||||
@@ -203,6 +204,7 @@
|
|
||||||
{"pidfile", required_argument, 0, 'p'},
|
|
||||||
{"quit", no_argument, 0, 'q'},
|
|
||||||
{"request", required_argument, 0, 'r'},
|
|
||||||
+ {"require", required_argument, 0, 'R'},
|
|
||||||
{"script", required_argument, 0, 's'},
|
|
||||||
{"version", no_argument, 0, 'v'},
|
|
||||||
{0, 0, 0, 0}
|
|
||||||
@@ -211,7 +213,7 @@
|
|
||||||
/* get options */
|
|
||||||
while (1) {
|
|
||||||
int option_index = 0;
|
|
||||||
- c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:s:v", arg_options, &option_index);
|
|
||||||
+ c = getopt_long(argc, argv, "c:fbH:h:i:np:qr:R:s:v", arg_options, &option_index);
|
|
||||||
if (c == -1) break;
|
|
||||||
|
|
||||||
switch (c) {
|
|
||||||
@@ -254,6 +256,11 @@
|
|
||||||
case 'r':
|
|
||||||
requested_ip = inet_addr(optarg);
|
|
||||||
break;
|
|
||||||
+ case 'R':
|
|
||||||
+ if (require_option(optarg)) {
|
|
||||||
+ fprintf(stderr,"WARNING: %s unknown/not-supported (Ignored)\n", optarg );
|
|
||||||
+ }
|
|
||||||
+ break;
|
|
||||||
case 's':
|
|
||||||
client_config.script = optarg;
|
|
||||||
break;
|
|
||||||
Index: networking/udhcp/options.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/options.c,v
|
|
||||||
retrieving revision 1.7
|
|
||||||
diff -u -r1.7 options.c
|
|
||||||
--- a/networking/udhcp/options.c 30 Jan 2004 23:45:12 -0000 1.7
|
|
||||||
+++ b/networking/udhcp/options.c 5 Mar 2004 14:32:46 -0000
|
|
||||||
@@ -57,7 +57,19 @@
|
|
||||||
[OPTION_S32] = 4
|
|
||||||
};
|
|
||||||
|
|
||||||
-
|
|
||||||
+/* find and mark requested item as required */
|
|
||||||
+int require_option(char *name)
|
|
||||||
+{
|
|
||||||
+ int i;
|
|
||||||
+ for (i = 0; dhcp_options[i].code; i++) {
|
|
||||||
+ if (strcmp(name, dhcp_options[i].name) == 0 ){
|
|
||||||
+ dhcp_options[i].flags |= OPTION_REQ;
|
|
||||||
+ return 0;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ return 1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/* get an option with bounds checking (warning, not aligned). */
|
|
||||||
uint8_t *get_option(struct dhcpMessage *packet, int code)
|
|
||||||
{
|
|
||||||
Index: networking/udhcp/options.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/options.h,v
|
|
||||||
retrieving revision 1.5
|
|
||||||
diff -u -r1.5 options.h
|
|
||||||
--- a/networking/udhcp/options.h 30 Jan 2004 23:45:12 -0000 1.5
|
|
||||||
+++ b/networking/udhcp/options.h 5 Mar 2004 14:32:46 -0000
|
|
||||||
@@ -30,6 +30,7 @@
|
|
||||||
extern struct dhcp_option dhcp_options[];
|
|
||||||
extern int option_lengths[];
|
|
||||||
|
|
||||||
+int require_option(char *name);
|
|
||||||
uint8_t *get_option(struct dhcpMessage *packet, int code);
|
|
||||||
int end_option(uint8_t *optionptr);
|
|
||||||
int add_option_string(uint8_t *optionptr, uint8_t *string);
|
|
@ -1,333 +0,0 @@
|
|||||||
Index: include/usage.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/include/usage.h,v
|
|
||||||
retrieving revision 1.191
|
|
||||||
diff -u -r1.191 usage.h
|
|
||||||
--- a/include/usage.h 25 Feb 2004 10:35:55 -0000 1.191
|
|
||||||
+++ b/include/usage.h 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -2606,7 +2606,8 @@
|
|
||||||
"\t-p,\t--pidfile=file\tStore process ID of daemon in file\n" \
|
|
||||||
"\t-q,\t--quit\tQuit after obtaining lease\n" \
|
|
||||||
"\t-r,\t--request=IP\tIP address to request (default: none)\n" \
|
|
||||||
- "\t-s,\t--script=file\tRun file at dhcp events (default: /usr/share/udhcpc/default.script)\n" \
|
|
||||||
+ "\t-s,\t--script=file\tRun file at dhcp events (default: " \
|
|
||||||
+ CONFIG_UDHCPC_SCRIPT_PATH ")\n" \
|
|
||||||
"\t-v,\t--version\tDisplay version"
|
|
||||||
|
|
||||||
#define udhcpd_trivial_usage \
|
|
||||||
Index: networking/udhcp/AUTHORS
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/AUTHORS,v
|
|
||||||
retrieving revision 1.3
|
|
||||||
diff -u -r1.3 AUTHORS
|
|
||||||
--- a/networking/udhcp/AUTHORS 18 Dec 2003 22:25:38 -0000 1.3
|
|
||||||
+++ b/networking/udhcp/AUTHORS 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -10,5 +10,5 @@
|
|
||||||
Moreton Bay (http://www.moretonbay.com/)
|
|
||||||
Vladimir Oleynik <dzo@simtrea.ru> Size optimizations
|
|
||||||
|
|
||||||
-
|
|
||||||
+Tony J. White <tjw@tjw.org> additional busybox build options
|
|
||||||
|
|
||||||
Index: networking/udhcp/Config.in
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/Config.in,v
|
|
||||||
retrieving revision 1.5
|
|
||||||
diff -u -r1.5 Config.in
|
|
||||||
--- a/networking/udhcp/Config.in 22 Oct 2003 09:58:38 -0000 1.5
|
|
||||||
+++ b/networking/udhcp/Config.in 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -58,5 +58,62 @@
|
|
||||||
|
|
||||||
See http://udhcp.busybox.net for further details.
|
|
||||||
|
|
||||||
+menu "udhcpd Configuration Options"
|
|
||||||
+ depends on CONFIG_UDHCPD
|
|
||||||
+
|
|
||||||
+config CONFIG_UDHCPD_CONF_PATH
|
|
||||||
+ string "Path to default udhcpd.conf"
|
|
||||||
+ default "/etc/udhcpd.conf"
|
|
||||||
+ depends on CONFIG_UDHCPD
|
|
||||||
+ help
|
|
||||||
+ The full path to udhcpd's default configuration file.
|
|
||||||
+ (default is: /etc/udhcpd.conf)
|
|
||||||
+
|
|
||||||
+config CONFIG_UDHCPD_LEASE_PATH
|
|
||||||
+ string "Path to default udhcpd.leases"
|
|
||||||
+ default "/var/lib/misc/udhcpd.leases"
|
|
||||||
+ depends on CONFIG_UDHCPD
|
|
||||||
+ help
|
|
||||||
+ The full path to udhcpd's default leases file.
|
|
||||||
+ (default is: /var/lib/misc/udhcpd.leases)
|
|
||||||
+
|
|
||||||
+config CONFIG_UDHCPD_PID_PATH
|
|
||||||
+ string "Path to default udhcpd PID file"
|
|
||||||
+ default "/var/run/udhcpd.pid"
|
|
||||||
+ depends on CONFIG_UDHCPD
|
|
||||||
+ help
|
|
||||||
+ The full path to udhcpd's default pid file.
|
|
||||||
+ (default is: /var/run/udhcpd.pid)
|
|
||||||
+
|
|
||||||
+endmenu
|
|
||||||
+
|
|
||||||
+menu "udhcpc Configuration Options"
|
|
||||||
+ depends on CONFIG_UDHCPC
|
|
||||||
+
|
|
||||||
+config CONFIG_UDHCPC_SCRIPT_PATH
|
|
||||||
+ string "Path to default udhcpc event script"
|
|
||||||
+ depends on CONFIG_UDHCPC
|
|
||||||
+ help
|
|
||||||
+ The full path to udhcpc's default event script file.
|
|
||||||
+ (default is: /usr/share/udhcpc/default.script OR
|
|
||||||
+ /share/udhcpc/default.script if CONFIG_INSTALL_NO_USR is set)
|
|
||||||
+
|
|
||||||
+ When udhcpc is started it executes this script to take care
|
|
||||||
+ of system tasks after it completes DHCP communication. Such
|
|
||||||
+ tasks include putting network interfaces up or down, setting
|
|
||||||
+ DNS info, adding routing information, etc.
|
|
||||||
+
|
|
||||||
+if CONFIG_INSTALL_NO_USR
|
|
||||||
+config CONFIG_UDHCPC_SCRIPT_PATH
|
|
||||||
+ default "/share/udhcpc/default.script"
|
|
||||||
+endif
|
|
||||||
+
|
|
||||||
+if !CONFIG_INSTALL_NO_USR
|
|
||||||
+config CONFIG_UDHCPC_SCRIPT_PATH
|
|
||||||
+ default "/usr/share/udhcpc/default.script"
|
|
||||||
+endif
|
|
||||||
+
|
|
||||||
+endmenu
|
|
||||||
+
|
|
||||||
endmenu
|
|
||||||
|
|
||||||
Index: networking/udhcp/README
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/README,v
|
|
||||||
retrieving revision 1.3
|
|
||||||
diff -u -r1.3 README
|
|
||||||
--- a/networking/udhcp/README 18 Dec 2003 22:25:38 -0000 1.3
|
|
||||||
+++ b/networking/udhcp/README 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -9,27 +9,42 @@
|
|
||||||
compile time options
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
-The Makefile contains three of the compile time options:
|
|
||||||
+The following options can be adjusted when configuring busybox:
|
|
||||||
|
|
||||||
- UDHCP_DEBUG: If UDHCP_DEBUG is defined, udhcpd will output extra
|
|
||||||
- debugging output, compile with -g, and not fork to the background when
|
|
||||||
- run.
|
|
||||||
- UDHCP_SYSLOG: If UDHCP_SYSLOG is defined, udhcpd will log all its
|
|
||||||
- messages syslog, otherwise, it will attempt to log them to stdout.
|
|
||||||
-
|
|
||||||
- COMBINED_BINARY: If COMBINED_BINARY is define, one binary, udhcpd,
|
|
||||||
- is created. If called as udhcpd, the dhcp server will be started.
|
|
||||||
- If called as udhcpc, the dhcp client will be started.
|
|
||||||
-
|
|
||||||
-dhcpd.h contains the other three compile time options:
|
|
||||||
-
|
|
||||||
- LEASE_TIME: The default lease time if not specified in the config
|
|
||||||
- file.
|
|
||||||
+ CONFIG_FEATURE_UDHCP_DEBUG:
|
|
||||||
+ If this is defined, udhcpd will output extra debugging output,
|
|
||||||
+ compile with -g, and not fork to the background when run.
|
|
||||||
|
|
||||||
- LEASES_FILE: The default file for storing leases.
|
|
||||||
-
|
|
||||||
- DHCPD_CONFIG_FILE: The defualt config file to use.
|
|
||||||
+ CONFIG_FEATURE_UDHCP_SYSLOG:
|
|
||||||
+ If this is defined, udhcpd will log all its messages syslog,
|
|
||||||
+ otherwise, it will attempt to log them to stdout.
|
|
||||||
+
|
|
||||||
+ CONFIG_UDHCPD_CONF_PATH:
|
|
||||||
+ The full path to udhcpd's default configuration file.
|
|
||||||
+
|
|
||||||
+ CONFIG_UDHCPD_LEASE_PATH:
|
|
||||||
+ The full path to udhcpd's default leases file.
|
|
||||||
+
|
|
||||||
+ CONFIG_UDHCPD_PID_PATH:
|
|
||||||
+ The full path to udhcpd's default pid file.
|
|
||||||
+
|
|
||||||
+ CONFIG_UDHCPC_SCRIPT_PATH:
|
|
||||||
+ The full path to udhcpc's default event script file.
|
|
||||||
+ (default is: /usr/share/udhcpc/default.script)
|
|
||||||
+
|
|
||||||
+ When udhcpc is started it executes this script to take care
|
|
||||||
+ of system tasks after it completes DHCP communication. Such
|
|
||||||
+ tasks include putting network interfaces up or down, setting
|
|
||||||
+ DNS info, adding routing information, etc.
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+dhcpd.h contains the another compile time option:
|
|
||||||
|
|
||||||
+ LEASE_TIME:
|
|
||||||
+ The default lease time if not specified in the config file.
|
|
||||||
+ This option can also be changed at runtime with the 'lease'
|
|
||||||
+ configuration option.
|
|
||||||
+
|
|
||||||
options.c contains a set of dhcp options for the client:
|
|
||||||
|
|
||||||
name[10]: The name of the option as it will appear in scripts
|
|
||||||
Index: networking/udhcp/README.udhcpc
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpc,v
|
|
||||||
retrieving revision 1.3
|
|
||||||
diff -u -r1.3 README.udhcpc
|
|
||||||
--- a/networking/udhcp/README.udhcpc 11 Dec 2002 21:12:44 -0000 1.3
|
|
||||||
+++ b/networking/udhcp/README.udhcpc 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -23,7 +23,8 @@
|
|
||||||
-q, --quit Quit after obtaining lease
|
|
||||||
-r, --request=IP IP address to request (default: none)
|
|
||||||
-s, --script=file Run file at dhcp events (default:
|
|
||||||
- /usr/share/udhcpc/default.script)
|
|
||||||
+ /usr/share/udhcpc/default.script or
|
|
||||||
+ CONFIG_UDHCPC_SCRIPT_PATH at build time)
|
|
||||||
-v, --version Display version
|
|
||||||
|
|
||||||
|
|
||||||
Index: networking/udhcp/README.udhcpd
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/README.udhcpd,v
|
|
||||||
retrieving revision 1.1
|
|
||||||
diff -u -r1.1 README.udhcpd
|
|
||||||
--- a/networking/udhcp/README.udhcpd 31 Oct 2002 19:21:27 -0000 1.1
|
|
||||||
+++ b/networking/udhcp/README.udhcpd 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -50,10 +50,14 @@
|
|
||||||
|
|
||||||
compile time options
|
|
||||||
-------------------
|
|
||||||
+
|
|
||||||
+During busybox configuration, you can change the default paths for
|
|
||||||
+udhcpd.conf, udhcpd.leases, and udhcpd.pid files. See README for
|
|
||||||
+more details.
|
|
||||||
|
|
||||||
-dhcpd.h contains the other two compile time options:
|
|
||||||
+dhcpd.h contains the compile time option:
|
|
||||||
|
|
||||||
LEASE_TIME: The default lease time if not specified in the config
|
|
||||||
file.
|
|
||||||
+
|
|
||||||
|
|
||||||
- DHCPD_CONFIG_FILE: The defualt config file to use.
|
|
||||||
Index: networking/udhcp/dhcpc.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/dhcpc.h,v
|
|
||||||
retrieving revision 1.4
|
|
||||||
diff -u -r1.4 dhcpc.h
|
|
||||||
--- a/networking/udhcp/dhcpc.h 30 Jan 2004 23:45:12 -0000 1.4
|
|
||||||
+++ b/networking/udhcp/dhcpc.h 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -2,7 +2,11 @@
|
|
||||||
#ifndef _DHCPC_H
|
|
||||||
#define _DHCPC_H
|
|
||||||
|
|
||||||
-#define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
|
|
||||||
+#ifdef CONFIG_UDHCPC_SCRIPT_PATH
|
|
||||||
+ #define DEFAULT_SCRIPT CONFIG_UDHCPC_SCRIPT_PATH
|
|
||||||
+#else
|
|
||||||
+ #define DEFAULT_SCRIPT "/usr/share/udhcpc/default.script"
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* allow libbb_udhcp.h to redefine DEFAULT_SCRIPT */
|
|
||||||
#include "libbb_udhcp.h"
|
|
||||||
Index: networking/udhcp/dhcpd.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.c,v
|
|
||||||
retrieving revision 1.5
|
|
||||||
diff -u -r1.5 dhcpd.c
|
|
||||||
--- a/networking/udhcp/dhcpd.c 30 Jan 2004 23:45:12 -0000 1.5
|
|
||||||
+++ b/networking/udhcp/dhcpd.c 5 Mar 2004 13:20:11 -0000
|
|
||||||
@@ -70,6 +70,13 @@
|
|
||||||
struct dhcpOfferedAddr *lease;
|
|
||||||
int max_sock;
|
|
||||||
unsigned long num_ips;
|
|
||||||
+ int daemonize = 1;
|
|
||||||
+
|
|
||||||
+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
|
|
||||||
+ daemonize = 0;
|
|
||||||
+ argv++;
|
|
||||||
+ argc--;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
memset(&server_config, 0, sizeof(struct server_config_t));
|
|
||||||
read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
|
|
||||||
@@ -99,9 +106,8 @@
|
|
||||||
&server_config.server, server_config.arp) < 0)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
-#ifndef UDHCP_DEBUG
|
|
||||||
- background(server_config.pidfile); /* hold lock during fork. */
|
|
||||||
-#endif
|
|
||||||
+ if(daemonize)
|
|
||||||
+ background(server_config.pidfile); /* hold lock during fork. */
|
|
||||||
|
|
||||||
/* Setup the signal pipe */
|
|
||||||
udhcp_sp_setup();
|
|
||||||
Index: networking/udhcp/dhcpd.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.h,v
|
|
||||||
retrieving revision 1.5
|
|
||||||
diff -u -r1.5 dhcpd.h
|
|
||||||
--- a/networking/udhcp/dhcpd.h 30 Jan 2004 23:45:12 -0000 1.5
|
|
||||||
+++ b/networking/udhcp/dhcpd.h 5 Mar 2004 13:20:12 -0000
|
|
||||||
@@ -15,11 +15,25 @@
|
|
||||||
|
|
||||||
/* the period of time the client is allowed to use that address */
|
|
||||||
#define LEASE_TIME (60*60*24*10) /* 10 days of seconds */
|
|
||||||
-#define LEASES_FILE "/var/lib/misc/udhcpd.leases"
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_UDHCPD_LEASE_PATH
|
|
||||||
+ #define LEASES_FILE CONFIG_UDHCPD_LEASE_PATH
|
|
||||||
+#else
|
|
||||||
+ #define LEASES_FILE "/var/lib/misc/udhcpd.leases"
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* where to find the DHCP server configuration file */
|
|
||||||
-#define DHCPD_CONF_FILE "/etc/udhcpd.conf"
|
|
||||||
+#ifdef CONFIG_UDHCPD_CONF_PATH
|
|
||||||
+ #define DHCPD_CONF_FILE CONFIG_UDHCPD_CONF_PATH
|
|
||||||
+#else
|
|
||||||
+ #define DHCPD_CONF_FILE "/etc/udhcpd.conf"
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
+#ifdef CONFIG_UDHCPD_PID_PATH
|
|
||||||
+ #define DHCPD_PID_FILE CONFIG_UDHCPD_PID_PATH
|
|
||||||
+#else
|
|
||||||
+ #define DHCPD_PID_FILE "/var/run/udhcpd.pid"
|
|
||||||
+#endif
|
|
||||||
/*****************************************************************/
|
|
||||||
/* Do not modify below here unless you know what you are doing!! */
|
|
||||||
/*****************************************************************/
|
|
||||||
Index: networking/udhcp/files.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/files.c,v
|
|
||||||
retrieving revision 1.13
|
|
||||||
diff -u -r1.13 files.c
|
|
||||||
--- a/networking/udhcp/files.c 30 Jan 2004 23:45:12 -0000 1.13
|
|
||||||
+++ b/networking/udhcp/files.c 5 Mar 2004 13:20:13 -0000
|
|
||||||
@@ -166,7 +166,7 @@
|
|
||||||
{"offer_time", read_u32, &(server_config.offer_time), "60"},
|
|
||||||
{"min_lease", read_u32, &(server_config.min_lease), "60"},
|
|
||||||
{"lease_file", read_str, &(server_config.lease_file), LEASES_FILE},
|
|
||||||
- {"pidfile", read_str, &(server_config.pidfile), "/var/run/udhcpd.pid"},
|
|
||||||
+ {"pidfile", read_str, &(server_config.pidfile), DHCPD_PID_FILE},
|
|
||||||
{"notify_file", read_str, &(server_config.notify_file), ""},
|
|
||||||
{"siaddr", read_ip, &(server_config.siaddr), "0.0.0.0"},
|
|
||||||
{"sname", read_str, &(server_config.sname), ""},
|
|
||||||
Index: networking/udhcp/libbb_udhcp.h
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/libbb_udhcp.h,v
|
|
||||||
retrieving revision 1.5
|
|
||||||
diff -u -r1.5 libbb_udhcp.h
|
|
||||||
--- a/networking/udhcp/libbb_udhcp.h 18 Dec 2003 22:25:38 -0000 1.5
|
|
||||||
+++ b/networking/udhcp/libbb_udhcp.h 5 Mar 2004 13:20:13 -0000
|
|
||||||
@@ -3,11 +3,6 @@
|
|
||||||
/* bit of a hack, do this no matter what the order of the includes.
|
|
||||||
* (for busybox) */
|
|
||||||
|
|
||||||
-#ifdef CONFIG_INSTALL_NO_USR
|
|
||||||
-#undef DEFUALT_SCRIPT
|
|
||||||
-#define DEFAULT_SCRIPT "/share/udhcpc/default.script"
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
#ifndef _LIBBB_UDHCP_H
|
|
||||||
#define _LIBBB_UDHCP_H
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
|||||||
Index: ./networking/udhcp/dhcpd.c
|
|
||||||
===================================================================
|
|
||||||
RCS file: /var/cvs/busybox/networking/udhcp/dhcpd.c,v
|
|
||||||
retrieving revision 1.5
|
|
||||||
diff -u -r1.5 dhcpd.c
|
|
||||||
--- a/./networking/udhcp/dhcpd.c 30 Jan 2004 23:45:12 -0000 1.5
|
|
||||||
+++ b/./networking/udhcp/dhcpd.c 5 Mar 2004 13:09:05 -0000
|
|
||||||
@@ -70,6 +70,13 @@
|
|
||||||
struct dhcpOfferedAddr *lease;
|
|
||||||
int max_sock;
|
|
||||||
unsigned long num_ips;
|
|
||||||
+ int daemonize = 1;
|
|
||||||
+
|
|
||||||
+ while (strcmp(argv[1],"-f")==0 || strcmp(argv[1],"--foreground")==0) {
|
|
||||||
+ daemonize = 0;
|
|
||||||
+ argv++;
|
|
||||||
+ argc--;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
memset(&server_config, 0, sizeof(struct server_config_t));
|
|
||||||
read_config(argc < 2 ? DHCPD_CONF_FILE : argv[1]);
|
|
||||||
@@ -99,9 +106,8 @@
|
|
||||||
&server_config.server, server_config.arp) < 0)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
-#ifndef UDHCP_DEBUG
|
|
||||||
- background(server_config.pidfile); /* hold lock during fork. */
|
|
||||||
-#endif
|
|
||||||
+ if(daemonize)
|
|
||||||
+ background(server_config.pidfile); /* hold lock during fork. */
|
|
||||||
|
|
||||||
/* Setup the signal pipe */
|
|
||||||
udhcp_sp_setup();
|
|
@ -1,26 +0,0 @@
|
|||||||
Testing to see if I can rename a file without blanking its history.
|
|
||||||
|
|
||||||
That'd be dalias' suggestion..
|
|
||||||
|
|
||||||
Mine was #define isdigit(a) (a>='0'&&a<='9'), but i forgot to record the
|
|
||||||
exact savings..
|
|
||||||
text data bss dec hex filename
|
|
||||||
864252 10252 645860 1520364 1732ec busybox_old
|
|
||||||
863714 10244 645892 1519850 1730ea busybox_unstripped
|
|
||||||
|
|
||||||
|
|
||||||
Index: include/libbb.h
|
|
||||||
===================================================================
|
|
||||||
--- include/libbb.h (revision 15244)
|
|
||||||
+++ include/libbb.h (working copy)
|
|
||||||
@@ -531,4 +531,10 @@
|
|
||||||
#include <dmalloc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if 1
|
|
||||||
+#include <ctype.h>
|
|
||||||
+#define _CTYPE_H 1 /* muahahaha */
|
|
||||||
+#undef isdigit
|
|
||||||
+#define isdigit(a) ((unsigned)(a)-'0' < 10)
|
|
||||||
+#endif
|
|
||||||
#endif /* __LIBBUSYBOX_H__ */
|
|
Loading…
Reference in New Issue
Block a user