Update internal.h to conditionally include asm/string.h
[oweals/busybox.git] / lsmod.c
diff --git a/lsmod.c b/lsmod.c
index 1696f756ed702fcb274cbc8c7f27a8ad05ddc778..d3b1bb79eb08707895340d15d14c8898c98ce62e 100644 (file)
--- a/lsmod.c
+++ b/lsmod.c
@@ -1,7 +1,8 @@
+/* vi: set sw=4 ts=4: */
 /*
  * Mini lsmod implementation for busybox
  *
- * Copyright (C) 1999 by Lineo, inc.
+ * Copyright (C) 1999,2000 by Lineo, inc.
  * Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
  *
  * This program is free software; you can redistribute it and/or modify
 #include <stdio.h>
 
 
+extern int lsmod_main(int argc, char **argv)
+{
+#if defined BB_FEATURE_USE_DEVPS_PATCH
+       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
 
-extern int lsmod_main(int argc, char **argv)
-{
-    char* cmd[] = { "cat", "/proc/modules", "\0" };
-    exit(cat_main( 3, cmd));
+       return(cat_main(3, cmd));
 }