diff options
author | Denis Vlasenko | 2007-06-04 10:16:52 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-06-04 10:16:52 +0000 |
commit | 74324c86663f57a19c1de303ee8c8e5449db9ef2 (patch) | |
tree | 11f5da9de4212875ce5811be2e1050e076378c9a /modutils/rmmod.c | |
parent | 4e5f82c76f08614d0b69f9ec4a8baac303af15f6 (diff) | |
download | busybox-74324c86663f57a19c1de303ee8c8e5449db9ef2.zip busybox-74324c86663f57a19c1de303ee8c8e5449db9ef2.tar.gz |
Audit bb_common_bufsiz usage, add script which looks for misuse.
tr: stop using globals needlessly.
code: -103 bytes
Diffstat (limited to 'modutils/rmmod.c')
-rw-r--r-- | modutils/rmmod.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modutils/rmmod.c b/modutils/rmmod.c index 4c792d3..f78f96c 100644 --- a/modutils/rmmod.c +++ b/modutils/rmmod.c @@ -44,6 +44,8 @@ int rmmod_main(int argc, char **argv) int n, ret = EXIT_SUCCESS; unsigned int flags = O_NONBLOCK|O_EXCL; +#define misc_buf bb_common_bufsiz1 + /* Parse command line. */ n = getopt32(argc, argv, "wfa"); if (n & 1) // --wait @@ -65,7 +67,7 @@ int rmmod_main(int argc, char **argv) pnmod = nmod; // the 1 here is QM_MODULES. if (ENABLE_FEATURE_QUERY_MODULE_INTERFACE && query_module(NULL, - 1, bb_common_bufsiz1, sizeof(bb_common_bufsiz1), + 1, misc_buf, sizeof(misc_buf), &nmod)) { bb_perror_msg_and_die("QM_MODULES"); @@ -84,10 +86,10 @@ int rmmod_main(int argc, char **argv) afterslash = strrchr(argv[n], '/'); if (!afterslash) afterslash = argv[n]; else afterslash++; - filename2modname(bb_common_bufsiz1, afterslash); + filename2modname(misc_buf, afterslash); } - if (syscall(__NR_delete_module, ENABLE_FEATURE_2_6_MODULES ? bb_common_bufsiz1 : argv[n], flags)) { + if (syscall(__NR_delete_module, ENABLE_FEATURE_2_6_MODULES ? misc_buf : argv[n], flags)) { bb_perror_msg("%s", argv[n]); ret = EXIT_FAILURE; } |