From 86b4d64aa3f5ca4c2824a8948541b0e18dfe0a74 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 3 Aug 2006 17:58:17 +0000 Subject: These should have been part of 15767 too. --- modutils/lsmod.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) (limited to 'modutils') diff --git a/modutils/lsmod.c b/modutils/lsmod.c index 1020158..18ee839 100644 --- a/modutils/lsmod.c +++ b/modutils/lsmod.c @@ -12,18 +12,18 @@ */ #include "busybox.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include +//#include #ifndef CONFIG_FEATURE_CHECK_TAINTED_MODULE @@ -151,15 +151,14 @@ int lsmod_main(int argc, char **argv) int lsmod_main(int argc, char **argv) { + FILE *file = xfopen("/proc/modules", "r"); + printf("Module Size Used by"); check_tainted(); #if defined(CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT) { - FILE *file; char line[4096]; - file = bb_xfopen("/proc/modules", "r"); - while (fgets(line, sizeof(line), file)) { char *tok; @@ -190,13 +189,10 @@ int lsmod_main(int argc, char **argv) } fclose(file); } - return EXIT_SUCCESS; #else - if (bb_xprint_file_by_name("/proc/modules") == 0) - return EXIT_SUCCESS; + xprint_and_close_file(file); #endif /* CONFIG_FEATURE_2_6_MODULES */ - - return EXIT_FAILURE; + return EXIT_SUCCESS; } #endif /* CONFIG_FEATURE_QUERY_MODULE_INTERFACE */ -- cgit v1.1