aboutsummaryrefslogtreecommitdiff
path: root/toys/lsmod.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-07-18 21:10:57 -0500
committerRob Landley <rob@landley.net>2012-07-18 21:10:57 -0500
commita76ba3d58ad526e9ee9bb0d86671ba1f39d99729 (patch)
tree23398fb2c56084ed97fdd58c0dc435ee0d1315bc /toys/lsmod.c
parent1af525d9f72491e68fb21573872841e5124a930d (diff)
downloadtoybox-a76ba3d58ad526e9ee9bb0d86671ba1f39d99729.tar.gz
Trivial cleanups.
Diffstat (limited to 'toys/lsmod.c')
-rw-r--r--toys/lsmod.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toys/lsmod.c b/toys/lsmod.c
index 07ef7f89..82dbb589 100644
--- a/toys/lsmod.c
+++ b/toys/lsmod.c
@@ -22,7 +22,8 @@ config LSMOD
void lsmod_main(void)
{
- FILE * file = xfopen("/proc/modules", "r");
+ char *modfile = "/proc/modules";
+ FILE * file = xfopen(modfile, "r");
xprintf("%-23s Size Used by\n", "Module");
@@ -35,7 +36,7 @@ void lsmod_main(void)
if (users[len] == ',' || users[len] == '-')
users[len] = 0;
xprintf("%-19s %8s %s %s\n", name, size, refcnt, users);
- } else perror_exit("unrecognized input");
+ } else perror_exit("bad %s", modfile);
}
fclose(file);
}