aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-03-08 06:42:34 +0000
committerErik Andersen <andersen@codepoet.org>2000-03-08 06:42:34 +0000
commit54969a1f6443b98c6874bd611de89b9ce30ca116 (patch)
treeb8803e07d5242f60a9668658c39d3ef33bf21b4b
parent692a4502b0205f083855a102f906e206733b5b93 (diff)
downloadbusybox-w32-54969a1f6443b98c6874bd611de89b9ce30ca116.tar.gz
busybox-w32-54969a1f6443b98c6874bd611de89b9ce30ca116.tar.bz2
busybox-w32-54969a1f6443b98c6874bd611de89b9ce30ca116.zip
Fixed up lsmod so it works with my devmodules kernel driver,
and with /proc. -Erik
-rw-r--r--busybox.def.h2
-rw-r--r--lsmod.c11
-rw-r--r--modutils/lsmod.c11
3 files changed, 15 insertions, 9 deletions
diff --git a/busybox.def.h b/busybox.def.h
index afdc46971..561c2ed4b 100644
--- a/busybox.def.h
+++ b/busybox.def.h
@@ -51,7 +51,7 @@
51//#define BB_LOGGER 51//#define BB_LOGGER
52#define BB_LOGNAME 52#define BB_LOGNAME
53#define BB_LS 53#define BB_LS
54#define BB_LSMOD 54//#define BB_LSMOD
55//#define BB_MAKEDEVS 55//#define BB_MAKEDEVS
56#define BB_MKFS_MINIX 56#define BB_MKFS_MINIX
57//#define BB_MATH 57//#define BB_MATH
diff --git a/lsmod.c b/lsmod.c
index b0b37bdd7..b8834d304 100644
--- a/lsmod.c
+++ b/lsmod.c
@@ -25,13 +25,16 @@
25#include <stdio.h> 25#include <stdio.h>
26 26
27 27
28//#if ! defined BB_FEATURE_USE_PROCFS
29//#error Sorry, I depend on the /proc filesystem right now.
30//#endif
31
32extern int lsmod_main(int argc, char **argv) 28extern int lsmod_main(int argc, char **argv)
33{ 29{
30#if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB
31 char *cmd[] = { "cat", "/dev/modules", "\0" };
32#else
33#if ! defined BB_FEATURE_USE_PROCFS
34#error Sorry, I depend on the /proc filesystem right now.
35#endif
34 char *cmd[] = { "cat", "/proc/modules", "\0" }; 36 char *cmd[] = { "cat", "/proc/modules", "\0" };
37#endif
35 38
36 exit(cat_main(3, cmd)); 39 exit(cat_main(3, cmd));
37} 40}
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index b0b37bdd7..b8834d304 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -25,13 +25,16 @@
25#include <stdio.h> 25#include <stdio.h>
26 26
27 27
28//#if ! defined BB_FEATURE_USE_PROCFS
29//#error Sorry, I depend on the /proc filesystem right now.
30//#endif
31
32extern int lsmod_main(int argc, char **argv) 28extern int lsmod_main(int argc, char **argv)
33{ 29{
30#if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB
31 char *cmd[] = { "cat", "/dev/modules", "\0" };
32#else
33#if ! defined BB_FEATURE_USE_PROCFS
34#error Sorry, I depend on the /proc filesystem right now.
35#endif
34 char *cmd[] = { "cat", "/proc/modules", "\0" }; 36 char *cmd[] = { "cat", "/proc/modules", "\0" };
37#endif
35 38
36 exit(cat_main(3, cmd)); 39 exit(cat_main(3, cmd));
37} 40}