Added support for ignoring '-g' per GNU ls, thanks to David Vrabel
[oweals/busybox.git] / lsmod.c
diff --git a/lsmod.c b/lsmod.c
index b0b37bdd78745e3297215f26bbbe6d1a541720ff..d3b1bb79eb08707895340d15d14c8898c98ce62e 100644 (file)
--- a/lsmod.c
+++ b/lsmod.c
@@ -2,7 +2,7 @@
 /*
  * 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>
 
 
-//#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_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
 
-       exit(cat_main(3, cmd));
+       return(cat_main(3, cmd));
 }