aboutsummaryrefslogtreecommitdiff
path: root/modutils/lsmod.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-10-10 04:20:21 +0000
committerEric Andersen <andersen@codepoet.org>2002-10-10 04:20:21 +0000
commit71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f (patch)
tree802990cf39a805f253b9d32f3888a7c749babd01 /modutils/lsmod.c
parentfdfe298a966da0e6eecdc355efd640acf73c00e5 (diff)
downloadbusybox-71ae64bdc6b044eef0a9f3bebd85cc4a6b67362f.tar.gz
last_patch61 from vodz:
New complex patch for decrease size devel version. Requires previous patch. Also removed small problems from dutmp and tar applets. Also includes vodz' last_patch61_2: Last patch correcting comment for #endif and more integrated with libbb (very reduce size if used "cat" applet also). Requires last_patch61 for modutils/config.in.
Diffstat (limited to 'modutils/lsmod.c')
-rw-r--r--modutils/lsmod.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index a2a582389..a03247f73 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -40,13 +40,15 @@
#include "busybox.h"
-
+#ifndef CONFIG_FEATURE_CHECK_TAINTED_MODULE
+static inline void check_tainted(void) { printf("\n"); }
+#else
#define TAINT_FILENAME "/proc/sys/kernel/tainted"
#define TAINT_PROPRIETORY_MODULE (1<<0)
#define TAINT_FORCED_MODULE (1<<1)
#define TAINT_UNSAFE_SMP (1<<2)
-void check_tainted(void)
+static void check_tainted(void)
{
int tainted;
FILE *f;
@@ -66,6 +68,7 @@ void check_tainted(void)
printf(" Not tainted\n");
}
}
+#endif
#ifdef CONFIG_FEATURE_QUERY_MODULE_INTERFACE
@@ -111,6 +114,7 @@ static int my_query_module(const char *name, int which, void **buf,
return my_ret;
}
+#endif
extern int lsmod_main(int argc, char **argv)
{
@@ -170,26 +174,16 @@ extern int lsmod_main(int argc, char **argv)
return( 0);
}
-#else /*CONFIG_FEATURE_OLD_MODULE_INTERFACE*/
+#else /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */
extern int lsmod_main(int argc, char **argv)
{
- int fd, i;
- char line[128];
-
printf("Module Size Used by");
check_tainted();
- fflush(stdout);
- if ((fd = open("/proc/modules", O_RDONLY)) >= 0 ) {
- while ((i = read(fd, line, sizeof(line))) > 0) {
- write(fileno(stdout), line, i);
- }
- close(fd);
- return 0;
- }
- perror_msg_and_die("/proc/modules");
+ if(print_file_by_name("/proc/modules") == FALSE)
return 1;
+ return 0;
}
-#endif /*CONFIG_FEATURE_OLD_MODULE_INTERFACE*/
+#endif /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */