diff options
| author | Eric Andersen <andersen@codepoet.org> | 2001-04-05 03:14:39 +0000 |
|---|---|---|
| committer | Eric Andersen <andersen@codepoet.org> | 2001-04-05 03:14:39 +0000 |
| commit | e76c3b08e105147e3cef7e8d38d65da2fac6b2e1 (patch) | |
| tree | 87f705b9e4e4e48700ac61e9538c637ae2b395a7 /modutils | |
| parent | 3c0364f3911ec9f43e1c8c96ec2c8e30b1b52c47 (diff) | |
| download | busybox-w32-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.tar.gz busybox-w32-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.tar.bz2 busybox-w32-e76c3b08e105147e3cef7e8d38d65da2fac6b2e1.zip | |
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.c | 24 | ||||
| -rw-r--r-- | modutils/lsmod.c | 3 | ||||
| -rw-r--r-- | modutils/rmmod.c | 7 |
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 @@ | |||
| 119 | #ifndef MODUTILS_MODULE_H | 119 | #ifndef MODUTILS_MODULE_H |
| 120 | static const int MODUTILS_MODULE_H = 1; | 120 | static const int MODUTILS_MODULE_H = 1; |
| 121 | 121 | ||
| 122 | #ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" | 122 | #ident "$Id: insmod.c,v 1.54 2001/04/05 03:14:39 andersen Exp $" |
| 123 | 123 | ||
| 124 | /* This file contains the structures used by the 2.0 and 2.1 kernels. | 124 | /* This file contains the structures used by the 2.0 and 2.1 kernels. |
| 125 | We do not use the kernel headers directly because we do not wish | 125 | We do not use the kernel headers directly because we do not wish |
| @@ -325,7 +325,7 @@ int delete_module(const char *); | |||
| 325 | #ifndef MODUTILS_OBJ_H | 325 | #ifndef MODUTILS_OBJ_H |
| 326 | static const int MODUTILS_OBJ_H = 1; | 326 | static const int MODUTILS_OBJ_H = 1; |
| 327 | 327 | ||
| 328 | #ident "$Id: insmod.c,v 1.53 2001/03/22 19:01:16 andersen Exp $" | 328 | #ident "$Id: insmod.c,v 1.54 2001/04/05 03:14:39 andersen Exp $" |
| 329 | 329 | ||
| 330 | /* The relocatable object is manipulated using elfin types. */ | 330 | /* The relocatable object is manipulated using elfin types. */ |
| 331 | 331 | ||
| @@ -1210,18 +1210,18 @@ int arch_create_got(struct obj_file *f) | |||
| 1210 | 1210 | ||
| 1211 | #if defined(BB_USE_GOT_ENTRIES) | 1211 | #if defined(BB_USE_GOT_ENTRIES) |
| 1212 | if (got_offset) { | 1212 | if (got_offset) { |
| 1213 | struct obj_section* relsec = obj_find_section(f, ".got"); | 1213 | struct obj_section* myrelsec = obj_find_section(f, ".got"); |
| 1214 | 1214 | ||
| 1215 | if (relsec) { | 1215 | if (myrelsec) { |
| 1216 | obj_extend_section(relsec, got_offset); | 1216 | obj_extend_section(myrelsec, got_offset); |
| 1217 | } else { | 1217 | } else { |
| 1218 | relsec = obj_create_alloced_section(f, ".got", | 1218 | myrelsec = obj_create_alloced_section(f, ".got", |
| 1219 | BB_GOT_ENTRY_SIZE, | 1219 | BB_GOT_ENTRY_SIZE, |
| 1220 | got_offset); | 1220 | got_offset); |
| 1221 | assert(relsec); | 1221 | assert(myrelsec); |
| 1222 | } | 1222 | } |
| 1223 | 1223 | ||
| 1224 | ifile->got = relsec; | 1224 | ifile->got = myrelsec; |
| 1225 | } | 1225 | } |
| 1226 | #endif | 1226 | #endif |
| 1227 | 1227 | ||
| @@ -1748,19 +1748,19 @@ old_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
| 1748 | while (*q++ == ','); | 1748 | while (*q++ == ','); |
| 1749 | } else { | 1749 | } else { |
| 1750 | char *contents = f->sections[sym->secidx]->contents; | 1750 | char *contents = f->sections[sym->secidx]->contents; |
| 1751 | char *loc = contents + sym->value; | 1751 | char *myloc = contents + sym->value; |
| 1752 | char *r; /* To search for commas */ | 1752 | char *r; /* To search for commas */ |
| 1753 | 1753 | ||
| 1754 | /* Break the string with comas */ | 1754 | /* Break the string with comas */ |
| 1755 | while ((r = strchr(q, ',')) != (char *) NULL) { | 1755 | while ((r = strchr(q, ',')) != (char *) NULL) { |
| 1756 | *r++ = '\0'; | 1756 | *r++ = '\0'; |
| 1757 | obj_string_patch(f, sym->secidx, loc - contents, q); | 1757 | obj_string_patch(f, sym->secidx, myloc - contents, q); |
| 1758 | loc += sizeof(char *); | 1758 | myloc += sizeof(char *); |
| 1759 | q = r; | 1759 | q = r; |
| 1760 | } | 1760 | } |
| 1761 | 1761 | ||
| 1762 | /* last part */ | 1762 | /* last part */ |
| 1763 | obj_string_patch(f, sym->secidx, loc - contents, q); | 1763 | obj_string_patch(f, sym->secidx, myloc - contents, q); |
| 1764 | } | 1764 | } |
| 1765 | 1765 | ||
| 1766 | argc--, argv++; | 1766 | 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 | |||
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | int query_module(const char *name, int which, void *buf, size_t bufsize, | 55 | int query_module(const char *name, int which, void *buf, size_t bufsize, size_t *ret); |
| 56 | size_t *ret); | ||
| 57 | 56 | ||
| 58 | /* Values for query_module's which. */ | 57 | /* Values for query_module's which. */ |
| 59 | static const int QM_MODULES = 1; | 58 | 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 @@ | |||
| 26 | #include <unistd.h> | 26 | #include <unistd.h> |
| 27 | #include <stdlib.h> | 27 | #include <stdlib.h> |
| 28 | #include <getopt.h> | 28 | #include <getopt.h> |
| 29 | #include <sys/syscall.h> | ||
| 30 | #include <linux/unistd.h> | ||
| 31 | #include "busybox.h" | 29 | #include "busybox.h" |
| 32 | #define __LIBRARY__ | ||
| 33 | 30 | ||
| 31 | extern int delete_module(const char * name); | ||
| 34 | 32 | ||
| 35 | 33 | ||
| 36 | /* And the system call of the day is... */ | ||
| 37 | _syscall1(int, delete_module, const char *, name) | ||
| 38 | |||
| 39 | extern int rmmod_main(int argc, char **argv) | 34 | extern int rmmod_main(int argc, char **argv) |
| 40 | { | 35 | { |
| 41 | int n, ret = EXIT_SUCCESS; | 36 | int n, ret = EXIT_SUCCESS; |
