summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2001-07-22 23:00:15 +0000
committerEric Andersen2001-07-22 23:00:15 +0000
commit8d79ce832062873e6328f616ebb0c80db32020e3 (patch)
treeeab4c5133f1c8d1fd898d13e000aae5c5673211b
parent20aab260e2f7011523402464fb079f48e5899890 (diff)
downloadbusybox-8d79ce832062873e6328f616ebb0c80db32020e3.zip
busybox-8d79ce832062873e6328f616ebb0c80db32020e3.tar.gz
Some patches to make dietlibc work...
-rw-r--r--Config.h3
-rw-r--r--Makefile2
-rw-r--r--applets.h3
-rw-r--r--applets/usage.h7
-rw-r--r--cmdedit.c2
-rw-r--r--coreutils/ls.c1
-rw-r--r--include/applets.h3
-rw-r--r--include/libbb.h2
-rw-r--r--include/usage.h7
-rw-r--r--init.c2
-rw-r--r--init/init.c2
-rw-r--r--libbb/libbb.h2
-rw-r--r--logger.c21
-rw-r--r--ls.c1
-rw-r--r--procps/ps.c1
-rw-r--r--ps.c1
-rw-r--r--shell/cmdedit.c2
-rw-r--r--sysklogd/logger.c21
-rw-r--r--usage.h7
19 files changed, 62 insertions, 28 deletions
diff --git a/Config.h b/Config.h
index 1daf65c..d40a959 100644
--- a/Config.h
+++ b/Config.h
@@ -75,11 +75,12 @@
#define BB_MKNOD
#define BB_MKSWAP
//#define BB_MKTEMP
-//#define BB_NC
+#define BB_MODPROBE
#define BB_MORE
#define BB_MOUNT
//#define BB_MT
#define BB_MV
+//#define BB_NC
//#define BB_NSLOOKUP
//#define BB_PING
//#define BB_PIVOT_ROOT
diff --git a/Makefile b/Makefile
index 8b4c16f..7ee55f8 100644
--- a/Makefile
+++ b/Makefile
@@ -351,7 +351,7 @@ busybox.links: busybox.mkll Config.h applets.h
nfsmount.o cmdedit.o: %.o: %.h
sh.o: cmdedit.h
$(OBJECTS): %.o: %.c Config.h busybox.h applets.h Makefile
- $(CC) -I- $(CFLAGS) -I. $(patsubst %,-I%,$(subst :, ,$(BB_SRC_DIR))) -c $< -o $*.o
+ $(CC) $(CFLAGS) -I. $(patsubst %,-I%,$(subst :, ,$(BB_SRC_DIR))) -c $< -o $*.o
$(PWD_OBJS): %.o: %.c Config.h busybox.h applets.h Makefile
- mkdir -p $(PWD_GRP)
diff --git a/applets.h b/applets.h
index 12a28d5..1fb6dcd 100644
--- a/applets.h
+++ b/applets.h
@@ -263,6 +263,9 @@
#ifdef BB_MKTEMP
APPLET(mktemp, mktemp_main, _BB_DIR_BIN)
#endif
+#ifdef BB_MODPROBE
+ APPLET(modprobe, modprobe_main, _BB_DIR_SBIN)
+#endif
#ifdef BB_MORE
APPLET(more, more_main, _BB_DIR_BIN)
#endif
diff --git a/applets/usage.h b/applets/usage.h
index b0b9722..2a20422 100644
--- a/applets/usage.h
+++ b/applets/usage.h
@@ -1084,6 +1084,13 @@
"$ ls -la /tmp/temp.mWiLjM\n" \
"-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n"
+#define modprobe_trivial_usage \
+ "[FILE ...]"
+#define modprobe_full_usage \
+ "Used for hight level module loading and unloading."
+#define modprobe_example_usage \
+ "$ modprobe cdrom\n"
+
#define more_trivial_usage \
"[FILE ...]"
#define more_full_usage \
diff --git a/cmdedit.c b/cmdedit.c
index 69f8337..3b47504 100644
--- a/cmdedit.c
+++ b/cmdedit.c
@@ -170,7 +170,7 @@ static void cmdedit_setwidth(int w, int redraw_flg);
static void win_changed(int nsig)
{
struct winsize win = { 0, 0, 0, 0 };
- static __sighandler_t previous_SIGWINCH_handler; /* for reset */
+ static sighandler_t previous_SIGWINCH_handler; /* for reset */
/* emulate || signal call */
if (nsig == -SIGWINCH || nsig == SIGWINCH) {
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 1019147..794a1d0 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -61,6 +61,7 @@ enum {
#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
+#include <termios.h>
#include <sys/ioctl.h>
#include "busybox.h"
diff --git a/include/applets.h b/include/applets.h
index 12a28d5..1fb6dcd 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -263,6 +263,9 @@
#ifdef BB_MKTEMP
APPLET(mktemp, mktemp_main, _BB_DIR_BIN)
#endif
+#ifdef BB_MODPROBE
+ APPLET(modprobe, modprobe_main, _BB_DIR_SBIN)
+#endif
#ifdef BB_MORE
APPLET(more, more_main, _BB_DIR_BIN)
#endif
diff --git a/include/libbb.h b/include/libbb.h
index bf5f0c1..c167e10 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -41,7 +41,7 @@
#include "../busybox.h"
#endif
-#if __GNU_LIBRARY__ < 5
+#if (__GNU_LIBRARY__ < 5) && (!defined __dietlibc__)
/* libc5 doesn't define socklen_t */
typedef unsigned int socklen_t;
/* libc5 doesn't implement BSD 4.4 daemon() */
diff --git a/include/usage.h b/include/usage.h
index b0b9722..2a20422 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1084,6 +1084,13 @@
"$ ls -la /tmp/temp.mWiLjM\n" \
"-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n"
+#define modprobe_trivial_usage \
+ "[FILE ...]"
+#define modprobe_full_usage \
+ "Used for hight level module loading and unloading."
+#define modprobe_example_usage \
+ "$ modprobe cdrom\n"
+
#define more_trivial_usage \
"[FILE ...]"
#define more_full_usage \
diff --git a/init.c b/init.c
index e057caa..ec144ea 100644
--- a/init.c
+++ b/init.c
@@ -84,7 +84,7 @@ static const int RB_DISABLE_CAD = 0;
static const int RB_AUTOBOOT = 0x01234567;
#endif
-#if __GNU_LIBRARY__ > 5
+#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__)
#include <sys/reboot.h>
#define init_reboot(magic) reboot(magic)
#else
diff --git a/init/init.c b/init/init.c
index e057caa..ec144ea 100644
--- a/init/init.c
+++ b/init/init.c
@@ -84,7 +84,7 @@ static const int RB_DISABLE_CAD = 0;
static const int RB_AUTOBOOT = 0x01234567;
#endif
-#if __GNU_LIBRARY__ > 5
+#if (__GNU_LIBRARY__ > 5) || defined(__dietlibc__)
#include <sys/reboot.h>
#define init_reboot(magic) reboot(magic)
#else
diff --git a/libbb/libbb.h b/libbb/libbb.h
index bf5f0c1..c167e10 100644
--- a/libbb/libbb.h
+++ b/libbb/libbb.h
@@ -41,7 +41,7 @@
#include "../busybox.h"
#endif
-#if __GNU_LIBRARY__ < 5
+#if (__GNU_LIBRARY__ < 5) && (!defined __dietlibc__)
/* libc5 doesn't define socklen_t */
typedef unsigned int socklen_t;
/* libc5 doesn't implement BSD 4.4 daemon() */
diff --git a/logger.c b/logger.c
index 623a4f9..9f73091 100644
--- a/logger.c
+++ b/logger.c
@@ -36,17 +36,18 @@
#include <sys/syslog.h>
#else
-/* We have to do this since the header file defines static
- * structures. Argh.... bad libc, bad, bad...
- */
#include <sys/syslog.h>
-
-typedef struct _code {
- char *c_name;
- int c_val;
-} CODE;
-extern CODE prioritynames[];
-extern CODE facilitynames[];
+# ifndef __dietlibc__
+ /* We have to do this since the header file defines static
+ * structures. Argh.... bad libc, bad, bad...
+ */
+ typedef struct _code {
+ char *c_name;
+ int c_val;
+ } CODE;
+ extern CODE prioritynames[];
+ extern CODE facilitynames[];
+# endif
#endif
/* Decode a symbolic name to a numeric value
diff --git a/ls.c b/ls.c
index 1019147..794a1d0 100644
--- a/ls.c
+++ b/ls.c
@@ -61,6 +61,7 @@ enum {
#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
+#include <termios.h>
#include <sys/ioctl.h>
#include "busybox.h"
diff --git a/procps/ps.c b/procps/ps.c
index 7afb009..9e96a54 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
+#include <termios.h>
#include <sys/ioctl.h>
#include "busybox.h"
diff --git a/ps.c b/ps.c
index 7afb009..9e96a54 100644
--- a/ps.c
+++ b/ps.c
@@ -36,6 +36,7 @@
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
+#include <termios.h>
#include <sys/ioctl.h>
#include "busybox.h"
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 69f8337..3b47504 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -170,7 +170,7 @@ static void cmdedit_setwidth(int w, int redraw_flg);
static void win_changed(int nsig)
{
struct winsize win = { 0, 0, 0, 0 };
- static __sighandler_t previous_SIGWINCH_handler; /* for reset */
+ static sighandler_t previous_SIGWINCH_handler; /* for reset */
/* emulate || signal call */
if (nsig == -SIGWINCH || nsig == SIGWINCH) {
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 623a4f9..9f73091 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -36,17 +36,18 @@
#include <sys/syslog.h>
#else
-/* We have to do this since the header file defines static
- * structures. Argh.... bad libc, bad, bad...
- */
#include <sys/syslog.h>
-
-typedef struct _code {
- char *c_name;
- int c_val;
-} CODE;
-extern CODE prioritynames[];
-extern CODE facilitynames[];
+# ifndef __dietlibc__
+ /* We have to do this since the header file defines static
+ * structures. Argh.... bad libc, bad, bad...
+ */
+ typedef struct _code {
+ char *c_name;
+ int c_val;
+ } CODE;
+ extern CODE prioritynames[];
+ extern CODE facilitynames[];
+# endif
#endif
/* Decode a symbolic name to a numeric value
diff --git a/usage.h b/usage.h
index b0b9722..2a20422 100644
--- a/usage.h
+++ b/usage.h
@@ -1084,6 +1084,13 @@
"$ ls -la /tmp/temp.mWiLjM\n" \
"-rw------- 1 andersen andersen 0 Apr 25 17:10 /tmp/temp.mWiLjM\n"
+#define modprobe_trivial_usage \
+ "[FILE ...]"
+#define modprobe_full_usage \
+ "Used for hight level module loading and unloading."
+#define modprobe_example_usage \
+ "$ modprobe cdrom\n"
+
#define more_trivial_usage \
"[FILE ...]"
#define more_full_usage \