summaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorErik Andersen2000-03-08 06:42:34 +0000
committerErik Andersen2000-03-08 06:42:34 +0000
commit54969a1f6443b98c6874bd611de89b9ce30ca116 (patch)
treeb8803e07d5242f60a9668658c39d3ef33bf21b4b /modutils
parent692a4502b0205f083855a102f906e206733b5b93 (diff)
downloadbusybox-54969a1f6443b98c6874bd611de89b9ce30ca116.zip
busybox-54969a1f6443b98c6874bd611de89b9ce30ca116.tar.gz
Fixed up lsmod so it works with my devmodules kernel driver,
and with /proc. -Erik
Diffstat (limited to 'modutils')
-rw-r--r--modutils/lsmod.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index b0b37bd..b8834d3 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -25,13 +25,16 @@
#include <stdio.h>
-//#if ! defined BB_FEATURE_USE_PROCFS
-//#error Sorry, I depend on the /proc filesystem right now.
-//#endif
-
extern int lsmod_main(int argc, char **argv)
{
+#if defined BB_FEATURE_USE_DEVPS_N_DEVMTAB
+ char *cmd[] = { "cat", "/dev/modules", "\0" };
+#else
+#if ! defined BB_FEATURE_USE_PROCFS
+#error Sorry, I depend on the /proc filesystem right now.
+#endif
char *cmd[] = { "cat", "/proc/modules", "\0" };
+#endif
exit(cat_main(3, cmd));
}