aboutsummaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2001-04-05 03:14:39 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2001-04-05 03:14:39 +0000
commite76c3b08e105147e3cef7e8d38d65da2fac6b2e1 (patch)
tree87f705b9e4e4e48700ac61e9538c637ae2b395a7 /modutils
parent3c0364f3911ec9f43e1c8c96ec2c8e30b1b52c47 (diff)
downloadbusybox-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.tar.gz
busybox-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.tar.bz2
A number of cleanups. Now compiles with libc5, glibc, and uClibc. Fix a few
shadowed variables. Move (almost) all syscalls to libbb/syscalls.c, so I can handle them sanely and all at once. -Erik
Diffstat (limited to 'modutils')
-rw-r--r--modutils/insmod.c24
-rw-r--r--modutils/lsmod.c3
-rw-r--r--modutils/rmmod.c7
3 files changed, 14 insertions, 20 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 0a7cb1e4a..ad1486b7b 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -119,7 +119,7 @@
#ifndef MODUTILS_MODULE_H
static const int MODUTILS_MODULE_H = 1;
-#ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $"
+#ident "$Id: insmod.c,v 1.54 2001/04/05 03:14:39 andersen Exp $"
/* This file contains the structures used by the 2.0 and 2.1 kernels.
We do not use the kernel headers directly because we do not wish
@@ -325,7 +325,7 @@ int delete_module(const char *);
#ifndef MODUTILS_OBJ_H
static const int MODUTILS_OBJ_H = 1;
-#ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $"
+#ident "$Id: insmod.c,v 1.54 2001/04/05 03:14:39 andersen Exp $"
/* The relocatable object is manipulated using elfin types. */
@@ -1210,18 +1210,18 @@ int arch_create_got(struct obj_file *f)
#if defined(BB_USE_GOT_ENTRIES)
if (got_offset) {
- struct obj_section* relsec = obj_find_section(f, ".got");
+ struct obj_section* myrelsec = obj_find_section(f, ".got");
- if (relsec) {
- obj_extend_section(relsec, got_offset);
+ if (myrelsec) {
+ obj_extend_section(myrelsec, got_offset);
} else {
- relsec = obj_create_alloced_section(f, ".got",
+ myrelsec = obj_create_alloced_section(f, ".got",
BB_GOT_ENTRY_SIZE,
got_offset);
- assert(relsec);
+ assert(myrelsec);
}
- ifile->got = relsec;
+ ifile->got = myrelsec;
}
#endif
@@ -1748,19 +1748,19 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv)
while (*q++ == ',');
} else {
char *contents = f->sections[sym->secidx]->contents;
- char *loc = contents + sym->value;
+ char *myloc = contents + sym->value;
char *r; /* To search for commas */
/* Break the string with comas */
while ((r = strchr(q, ',')) != (char *) NULL) {
*r++ = '\0';
- obj_string_patch(f, sym->secidx, loc - contents, q);
- loc += sizeof(char *);
+ obj_string_patch(f, sym->secidx, myloc - contents, q);
+ myloc += sizeof(char *);
q = r;
}
/* last part */
- obj_string_patch(f, sym->secidx, loc - contents, q);
+ obj_string_patch(f, sym->secidx, myloc - contents, q);
}
argc--, argv++;
diff --git a/modutils/lsmod.c b/modutils/lsmod.c
index 8251705de..0f1b09b9e 100644
--- a/modutils/lsmod.c
+++ b/modutils/lsmod.c
@@ -52,8 +52,7 @@ struct module_info
};
-int query_module(const char *name, int which, void *buf, size_t bufsize,
- size_t *ret);
+int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret);
/* Values for query_module's which. */
static const int QM_MODULES = 1;
diff --git a/modutils/rmmod.c b/modutils/rmmod.c
index 36857e02c..7596d0232 100644
--- a/modutils/rmmod.c
+++ b/modutils/rmmod.c
@@ -26,16 +26,11 @@
#include <unistd.h>
#include <stdlib.h>
#include <getopt.h>
-#include <sys/syscall.h>
-#include <linux/unistd.h>
#include "busybox.h"
-#define __LIBRARY__
+extern int delete_module(const char * name);
-/* And the system call of the day is... */
-_syscall1(int, delete_module, const char *, name)
-
extern int rmmod_main(int argc, char **argv)
{
int n, ret = EXIT_SUCCESS;